0

I originally posted this question on the code review forum, but was directed back to StackOverflow.

One contributor said that it was a problem with my Apache/server setup, but why only is one .js file affected? Problem described here:

I am a bit of a jQuery raven, I learn and take as needed forage about, and have no formal education, so your patience is appreciated.

I have a main issue that a jQuery plugin is not working on the server, but works locally.

I have checked for the usual oversights (having relative links not on the server, having all the required files on the server & case sensitivity issues), but it still wouldn't work.

I am not fluent in the FireFox debugging tools either, however I found a enormous anamoly which I suspect is causing the issue.

The plugin code is in it's own .js file, and in the "debugger" in firefox, when I click on the appropriate file, instead of previewing the .js file, it shows me the index PHP/HTML of the root for the domain.

For specific, real examples:

Example page where the plugin is failing: Here

Here are the error messages that I get under the "Console" tab in FireFoxe's tools:

SyntaxError: syntax error @ http://bcw.se/3point0/js2013/imageScroller.js:1

TypeError: $(...).tinyscrollbar is not a function @ http://bcw.se/3point0/index_debug_crousel_02.html:75

Use of Mutation Events is deprecated. Use MutationObserver instead. @ http://code.jquery.com/jquery-latest.js:3492

And I presume the first two errors above are due to the anamoly and causing the failure, not directing properly to the right .js file, see screen dump below:

screendump of the firefox debugger showing a funny result when linking to a .js file.

Can anyone help and is this the right forum?

Thanks in advance.

4

1 回答 1

0

您的文件被称为ImageScroller.js而不是imageScroller.js. 改变它,它应该工作。(Apache 应该区分大小写)

由于imageScroller.js不存在,因此 url 被重写到索引页面(可能由您的 .htaccess RewriteRule)。

语法错误的根源很明显 - 浏览器尝试将获取的“js”文件解析为 JavaScript。但只是不是有效的 JavaScript ;)。

真诚的路易斯

于 2013-09-10T08:57:35.113 回答