我有一个问题已经在网上搜索了几个小时,但是找不到解决方案。 我写了一个包含JQuery的网页。 它在本地运行文件(作为文件),但是在网络服务器上,它一直给我一个错误:“未捕获的ReferenceError:未定义jQuery”。 当我调试本地加载到chrome中的html时,我可以看到引用的.js文件的内容。 但是,当页面在Web服务器上运行时调试相同的文件时,我可以在调试器中看到.js文件,但它们显示为空,因此没有内容。 文件的路径是正确的,因为调试器不会对未找到的文件提供任何错误。

请帮忙??? 这是我的代码:

 <?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> 

===============>>#1 票数:0

试试这个文件

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

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

===============>>#2 票数:0

您可以使用jQuery CDN

 <?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="https://cdn.jsdelivr.net/npm/jquery-treetable@3.2.0-1/css/jquery.treetable.css"/> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/jquery-treetable@3.2.0-1/css/jquery.treetable.theme.default.css"/> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/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="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery-treetable@3.2.0-1/jquery.treetable.min.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

未解决问题?本站智能推荐:

关注微信公众号