简体   繁体   English

jQuery / Javascript无法在我的服务器上运行,只能在本地计算机上运行

[英]jQuery/Javascript won't run on my server, local machine only

I've seen a lot of these questions listed but none actually answered the questions. 我已经列出了很多这样的问题,但实际上没有一个回答。 I made a word cloud on a local machine and it worked like a charm. 我在本地计算机上制作了一个词云,它的工作原理很像魅力。 I loaded it onto the server and now the scripts won't run. 我将其加载到服务器上,现在脚本无法运行。 I thought it might have to do with the src links but I even went so far as to put the full path in there and that didn't help at all. 我以为这可能与src链接有关,但我什至甚至把完整的路径放在那里,但这根本没有帮助。

here is the link to my page: www.johnverber.com/wordcloud/wordcloud.html 这是我页面的链接:www.johnverber.com/wordcloud/wordcloud.html

Any thoughts or otherwise would be appreciated. 任何想法或其他方式将不胜感激。 Below is the code for my script links: 以下是我的脚本链接的代码:

<link REL = "stylesheet" type = "text/css" href="styles.css">
    <script type="text/javascript"  src =     "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/jquery.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/tagtools.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/openDocTools.js"></script>
<script type="text/javascript"  src = "www.johnverber.com/home/johnverb/public_html/wordcloud/executeTag.js"></script>

You need to make your paths absolute. 您需要使路径绝对。 Add the http:// before all your script paths. 在所有脚本路径之前添加http:// It would also appear that most (if not all) of your scripts are missing from the server. 服务器上似乎还会丢失大多数(如果不是全部)脚本。

Look at the net tab in the browser, you will see your urls are wrong. 在浏览器中查看net选项卡,您将看到您的网址错误。

GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/jquery.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/tagtools.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/openDocTools.js 404 (Not Found) wordcloud.html:6
GET http://www.johnverber.com/wordcloud/www.johnverber.com/home/johnverb/public_html/wordcloud/executeTag.js 404 (Not Found) wordcloud.html:6

Your script paths are wrong, remove the home/johnverb/public_html/ part and include the protocol ie http:// if you are using absolute paths 您的脚本路径错误,请删除home/johnverb/public_html/部分,并包含协议,即http://如果您使用的是绝对路径)

http://www.johnverber.com/wordcloud/jquery.js
http://www.johnverber.com/wordcloud/openDocTools.js
http://www.johnverber.com/wordcloud/executeTag.js
http://www.johnverber.com/wordcloud/tagtools.js[404 not found]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM