[英]I have two different domains with the same code, but one of them doesn't work. Why?
I am using the same code with two sub-domains which are hosted on the same server. 我将同一代码用于托管在同一服务器上的两个子域。 The code is working on the first one but not on the second one.
该代码适用于第一个,但不适用于第二个。
Could the reason be $(document).ready( function()
because outside of $(document).ready( function()
scripts are working? 原因可能是
$(document).ready( function()
因为$(document).ready( function()
脚本之外的脚本正在工作吗?
The code is: 代码是:
$("#xdiv").autocomplete("script/get_list.php", {
width: 200,
matchContains: true,
selectFirst: false
});
$("#xdiv").result(function(event, data, formatted) {
$("#idmc").val(data[1]);
$("#mcc").val(data[2]);
});
There are issues with trying to run javascript from a different subdomain and can depend on the browser and security settings you have enabled. 尝试从其他子域运行javascript时会出现问题,并且可能取决于您启用的浏览器和安全设置。 I'm just guessing as your question is unclear and doesn't contain steps to reproduce the problem.
我只是在猜测,因为您的问题尚不清楚,并且不包含重现该问题的步骤。
If you have the old subdomain online still and need it to be until this one works, modify your host file (or something else if not on Windows) so that the old subdomain hits nothing. 如果旧的子域仍然在线,并且需要一直在线直到该子域生效,请修改您的主机文件(如果不在Windows上,则需要其他操作),以使旧的子域没有任何作用。 Now you should be able to get some meaningful errors showing you where your reference is.
现在您应该能够得到一些有意义的错误,向您显示参考的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.