Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

javascript - Javascript在本地运行,但不在Web服务器上运行。 (未捕获的ReferenceError:未定义jQuery)(Javascript working locally but not on webserver. (Uncaught ReferenceError: jQuery is not defined))

I have a problem for which I have been searching the net for hours, but I can't find the solution.

(我有一个问题已经在网上搜索了几个小时,但是找不到解决方案。)

I wrote a webpage with JQuery included.

(我写了一个包含JQuery的网页。)

It runs file locally (as a file), but on the webserver, it keeps giving me an error: 'Uncaught ReferenceError: jQuery is not defined'.

(它在本地运行文件(作为文件),但是在网络服务器上,它一直给我一个错误:“未捕获的ReferenceError:未定义jQuery”。)

When I debug the html when loaded in chrome locally I can see the content of the referenced .js files.

(当我调试本地加载到chrome中的html时,我可以看到引用的.js文件的内容。)

However when I debug the same files when the page runs on the webserver I can see the .js files in the debugger, but they appear all empty, ergo no content.

(但是,当页面在Web服务器上运行时调试相同的文件时,我可以在调试器中看到.js文件,但它们显示为空,因此没有内容。)

The paths to the files is correct as the debugger gives no errors on the files not found.

(文件的路径是正确的,因为调试器不会对未找到的文件提供任何错误。)

Please, help???

(请帮忙???)

Here is my code:

(这是我的代码:)

 <?xml version="1.0" encoding="UTF-8"?> <html><head> <link rel="stylesheet" type="text/css" href="web.css"/> <link rel="stylesheet" type="text/css" href="jquery/jquery.treetable.css"/> <link rel="stylesheet" type="text/css" href="jquery/jquery.treetable.theme.default.css"/> <link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css"/> </head> <body> <Template>HEADER</Template> <table id="statustable"><tr><th><div><span>Type</span></div></th><th><div><span>Nummer</span></div></th><th><div><span>Beschrijving</span></div></th><th><div><span>Status</span></div></th><th><div><span>SubStatus</span></div></th><th><div><span>Prod. soort</span></div></th><th><div><span>Plaat Best.</span></div></th><th><div><span>Rail spuiter</span></div></th><th><div><span>Hout</span></div></th><th><div><span>Aluminium</span></div></th><th><div><span>Staal</span></div></th><th><div><span>Rubberen</span></div></th><th><div><span>Assemblage</span></div></th><th><div><span>Werknemer</span></div></th></tr><tr data-tt-id="1"><td style="background-color:lightblue;">Project</td><td>BV19073</td><td>Engel</td><td>Order</td><td>Gereed</td></tr><tr data-tt-id="1.1" data-tt-parent-id="1"><td style="background-color:lightblue;">Order</td><td>1900198</td><td>Engel</td><td>Order</td><td>Productie_gereed</td><td style="background-color:green;">PRODUCTIE</td><td style="background-color:green;">Gereed</td><td style="background-color:Red;">Geen</td></tr><tr data-tt-id="1.1.1" data-tt-parent-id="1.1"><td style="background-color:lightblue;">Samenstelling</td><td>01.</td><td>Wand A P90 46/47 dB</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.1" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.01.</td><td>Wall Stanchion Telescopic (WST)</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.2" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.02.</td><td>Wall Stanchion Standard (WSS)</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.3" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.03.</td><td>Standard Panel (SP)</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.4" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.04.</td><td>Telescopic Panel (TP)</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.5" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.05.</td><td>extra platen ivm min. best.</td><td>Gereed</td></tr><tr data-tt-id="1.1.1.6" data-tt-parent-id="1.1.1"><td style="background-color:lightblue;">Onderdeel</td><td>01.06.</td><td>Uren per wand.</td><td>Gereed</td></tr></table><table id="formtable"><tr><td><button type="button" onclick="window.location.href='##BASEURL##/list/orderpost'">Vernieuwen</button></td></tr></table><Template>FOOTER</Template> <script src="jquery/external/jquery/jquery.js"></script> <script src="jquery/jquery-ui.js"></script> <script src="jquery/jquery.treetable.js"></script> <script src="jquery/test.js"></script> <script>(function($){$("#statustable").treetable({ expandable: true })})(jQuery);</script> </body> </html> 

  ask by M.devries translate from so


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this file Worked it

(试试这个文件)

New Js file add or old Js file remove

(添加新的Js文件或删除旧的Js文件)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...