使用jQuery
and时Ajax
,我将整个 URL 传递给 ajaxurl:
以防万一URL
不存在(不知何故),我怎么page not found
能从内部重定向到页面ajax
?通过url
并.htaccess
归档。
$(document).ready(function() {
$('.link').click(function () {
var parentTag = 'check=checked';
if(parentTag) {
// ajax call
$.ajax({
type:"GET",
url:"/mylink/buyers/1/0/0", //If this failed, how do I redirect to something else from here?
data:parentTag,
dataType: 'json',
beforeSend:function(callBack){
console.log('checked');
},
success: function(callBack){
console.log('Success');
},
error: function(callBack){
console.log('Failed');
},
});
}
return false;
});
});