【问题标题】:Not working after reupload main javascript file重新上传主 javascript 文件后无法正常工作
【发布时间】:2016-08-14 15:49:04
【问题描述】:

我使用 nano 命令更改了 main.js 文件中的一行。

这是行。

之前:

document.location = '?premium,promotion';

之后:

document.location = '?premium,8';

我刚刚保存了它。现在,我发现 main.js 中的其他函数都没有工作。我之前改过那条线,还是一样。

我在 debian 上使用 Nginx。也许我应该重新启动 ajax 什么的? 当我在我的 chrome 浏览器中 explore 时,我看到了这个错误:

Uncaught ReferenceError: userid is not defined main.js:140

main.js的140行是:

// user activity
$.post('ajax.php', { action: 'activity', user: userid });
setInterval(function() {
    $.post('ajax.php', { action: 'activity', user: userid });
}, 60*1000);

这是 main.js 文件:

http://pastebin.com/wgH7N4Da

这里是 ajax.php:

http://pastebin.com/ewueSuQn

问题出在哪里?

【问题讨论】:

    标签: javascript php ajax nginx


    【解决方案1】:

    我看到了 js 代码,根据错误所说,您需要将用户 ID 定义为变量或放在单引号内。

    【讨论】:

    • 但我没有改变其他任何东西。比如ajax.php我没改过。
    猜你喜欢
    • 1970-01-01
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 2011-01-24
    相关资源
    最近更新 更多