jquery ajax调用空查询字符串

所以,我正在使用jquery对我服务器上的php脚本进行ajax调用。

出于某种原因,我无法弄清楚,但是,没有发送查询字符串。 在$ _GET对象上使用var_dump()表明它是一个空字符串,Chrome的网络活动开发人员工具表明没有发送字符串。

$.ajax({ "url":"../script/content.php", "settings": { "dataType":"html", "type":"GET", "data":{ "id":$(this).prop('id') } } }).done( function(msg) { //$('#debug').html(msg); $('#dialog').html(msg); $('#dialog').load(function() { $('#close').click(function() { $('#over').fadeOut(fadeTime); }); if ($('#unique') > 0) { $('#unique').load(function(){ $('#over').fadeIn(fadeTime); }); } else { $('#over').fadeIn(fadeTime); } }); }); 

我曾经尝试过没有引号的ajax调用,他们手头没有必要,结果是一样的…我只是把它们放进去因为我认为这可能是问题…虽然我认为这样的符号引号没有区别,除非其中一个字段值应该是一个字符串。

该代码中是否有任何明确的内容可能导致查询字符串无法发送? 我想我的语法有问题…我只是看不到它。

#dialog加载回调似乎永远不会被调用,但我猜这是另一个问题。

试试这个

 $.ajax({ //The link we are accessing with params url:'http://example.com/script/content.php' + '?id=' + $(this).prop('id'), // The type of request. type: "get", //The type of data that is getting returned. dataType: "html", error: function(){ //something here }, success: function( strData ){ //something here } });