Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 jQuery 向 php 页面发出 ajax 请求。我正在使用与以下 javascript 代码类似的东西:
$.ajax("#putItHere", { success:"test.php?fish=pope" });
请注意,这适用于 $("#putItHere").load("test.php?fish=pope")。谁能告诉我为什么这不起作用?
正确的语法是:
$.ajax("test.php?fish=pope", { success: function(result) { $("#putItHere").html(result); } });
$.ajax({ url: "test.php", data: { fish: 'pope' }, success: function(data){ // do stuff with returned data here });
我想这就是你想要的...