Last active
December 29, 2015 02:39
-
-
Save boy3vil/7601709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.bagian_kiri ul li:nth-child(1)').click(function(){ | |
ajax_load({ url: "ajax/cek.php", data: {}, location: $('.bagian_kiri div:nth-child(2)').find('div:nth-child(1)') }); | |
}); | |
$('.bagian_kiri ul li:nth-child(2)').click(function(){ | |
ajax_load({ url: "ajax/cek.php", data: {}, location: $('.bagian_kiri div:nth-child(2)').find('div:nth-child(2)') }); | |
}); | |
}); | |
function ajax_load(load){ | |
//load.url | |
//load.data | |
//load.location | |
$.ajax({ | |
type: 'POST', | |
url: load.url, | |
data: load.data, | |
async: true, | |
cache: false, | |
dataType: 'html', | |
beforeSend:function(){ | |
$('.liad_image').show(); | |
}, | |
success: function (result) { | |
load.location.html(result); | |
$('.liad_image').hide(); | |
}, | |
error:function(){ | |
alert('refres page'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment