Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery json调用在mls/idx页面上不起作用_Jquery_Cross Domain_Jsonp - Fatal编程技术网

jQuery json调用在mls/idx页面上不起作用

jQuery json调用在mls/idx页面上不起作用,jquery,cross-domain,jsonp,Jquery,Cross Domain,Jsonp,我的房地产网站包含来自第三方服务器的mls/idx数据。jQuery函数在我自己的站点上运行得很好,但是无论何时在mls/idx页面上,jQuery调用都不起作用。在idx页面上,jQuery库是如何包含的: .... <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.5.1'></script> <scr

我的房地产网站包含来自第三方服务器的mls/idx数据。jQuery函数在我自己的站点上运行得很好,但是无论何时在mls/idx页面上,jQuery调用都不起作用。在idx页面上,jQuery库是如何包含的:

....    
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.5.1'></script>
<script type="text/javascript">
   var jq = $.noConflict();
</script>

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js'></script></head>
....
。。。。
var jq=$.noConflict();
....
下面是元素的定义和jQuery的调用方式:

<select id="select_agent_id" name="select_agent_id">
    <option value="cw123">C.W.</option>
    <option value="ds123" selected="selected">D.S.</option>
    <option value="jl456">J.L.</option>
</select>


<script language="javascript" type="text/javascript">
jq(document).ready(function() {
    jq("#select_agent_id").change(function() {
        jq.getJSON("http://mysite.com/wp-content/themes/mytheme/get_agent_info.php", {"agent_id" : jq(this).val()}, function(agent,status) {
            jq("#first_name").html(agent.first_name);
            jq("#last_name").html(agent.last_name);
            jq("#agent_title").html(agent.agent_title);
            ....
        });
    });
});
</script>

C.W。
博士。
J.L。
jq(文档).ready(函数(){
jq(“#选择#代理_id”).change(函数(){
jq.getJSON(“http://mysite.com/wp-content/themes/mytheme/get_agent_info.php“,{”agent_id:jq(this).val()},函数(agent,status){
jq(“#first_name”).html(agent.first_name);
jq(“#姓氏”).html(agent.last_name);
jq(“#agent_title”).html(agent.agent_title);
....
});
});
});
有人能帮我找出哪里不对劲吗?第三方idx提供商根本帮不上忙。非常感谢

只包括

回调=

作为URL中的参数。这将把调用转换为JSONP,这是进行跨域调用所必需的


更多信息:

如果您更改为:src=“//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”,请输入
1.9.1
所需的特定版本,并且前面没有http。RE:jQuery库是否位于脚本的顶部?控制台中有错误吗?谢谢KingKongFrog,它确实被认为是跨域请求,所以需要jsonp。