简体   繁体   English

我有两个具有相同代码的不同域,但是其中一个不起作用。 为什么?

[英]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.

相关问题 无法理解为什么此代码不起作用。 我的 sql 数据库有问题。 $sqll="SELECT * FROM netbarg WHERE r_number='02177736'" - Cannot understand why this code doesn't work. I have some trouble with my sql database. $sqll="SELECT * FROM netbarg WHERE r_number='02177736'" 速记IF不起作用。 为什么? - Shorthand IF doesn't work. Why? 相同的代码在不同的服务器上不起作用 - same code doesn't work on different server 在RewriteRule中,如果模式和替换以相同的字符串开头,则RewriteRule不起作用。 为什么? - In RewriteRule if pattern and substitution begin with the same string, the RewriteRule doesn't work. Why? SimplePie多个提要演示代码不起作用。 我应该怎么用呢? - SimplePie multiple feed demonstration code doesn't work. What should I use instead? MySQL-我有两个查询,但是一个不起作用,一个可以。 请帮帮我? - MySQL - I have two query but one doesn't work, and one does. Help me please? 我的简单HTML上传器无法正常工作。 为什么? - My simple HTML uploader doesn't work. WHY? WordPress的add_rewrite_rule不起作用。 为什么? - Wordpress add_rewrite_rule doesn't work. Why? 我有两个if和else条件,但是else条件不起作用,总是显示 - I have two if and one else condition, but the else condition doesn't work and always shows UNION和JOIN 3个表,其中之一没有相同的行号 - UNION and JOIN 3 tables, One of them doesn't have the same rows number
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM