我在我的 ajax 请求中传递了一个 json,但它每次只返回 10,为什么?
为什么我的阵列没有通过?
这是我的代码:
jQuery(document).ready(function($){
$('#list-3 .ajaxcall').click(function(){
$.ajax({
type : "GET",
url : ajaxurl,
dataType: 'json',
contentType: "application/json; charset=utf-8",
data : {
gpl_args : JSON.stringify({"cat":"26","posts_per_page":"4","paged":1}),
gpl_layout : {"show_thumb":"1","columns":"4","thumb_height":"85","thumb_width":"85","title_link":"1","content_excerpt":"50","posts_per_page":"4"}
},
success : function(response) {
// The server has finished executing PHP and has returned something,
// so display it!
$("#list-3").append(response);
}
});
});
});
和:
$args = isset($_REQUEST['gpl_args']);
//$args = json_encode(isset($_REQUEST['gpl_args']));
print_r($args)
更新:
my data inside ajax:
data : { gpl_args : JSON.stringify(<?php echo json_encode($args); ?>),
JSON.stringify(gpl_layout : <?php echo json_encode($layout); ?>)},