I have a website that runs on WordPress. The site uses several JavaScript components. Most notably the slides on the homepage, the schedule, and the contact form. All of the features work as expected in Chrome, Firefox, and other good browsers, but not in IE.
All of these features break due to problems that show up in the JavaScript. I have included several samples of what is happening below:
Error in IE Debug Console: “SCRIPT1006: Expected: ‘)’ – modernizr.foundation.js?ver=3.4.2, line 4 character 94”
m.join(a";")(b||"")
Actual file on the server:
m.join(a+";")(b||"")
Error in IE Debug Console: “SCRIPT1006: Expected: ‘)’ – jquery.js?ver=1.7.2, line 2 character 148”
d=f("<"">")
Actual file on the server:
d=f("<"+a+">")
They all follow this pattern of missing characters (most often ‘+’ signs). I am completely flummoxed as to what would cause this problem in Internet Explorer and would be relieved to know what’s going on, and how to fix it.
It’s to do with the way you’re serving .js files. In particular your modernizr, you are bringing in as follows:
(by the way, you have many JS and CSS files, it would be better if you could combine them, also your load order is a bit suspect, but that’s not the main problem)
If you simply access the URL:
http://rowbotfitness.com/wp-content/themes/businesspro/core/library/js/foundation/modernizr.foundation.js
…in Firefox, then look at the error that pops up in your Firebug console, you’ll see the error that is causing you grief in IE:
Not sure what is generating that JS file for you (with the ?ver=3.4.2) but you’d be better off linking straight to a JS file, and then setting up the correct MIME type in your webserver software. See here for a discussion on StackOverflow about that:
Javascript MIME Type
two ideas on that:
encoding mismatch! Sure that all files share the same encoding and that they match the encoding the webserver pretends to deliver?
sure that there are no vars that might contain a CariageReturn or LineFeed ? Comin from Databases those effects might occure. This can scramble your Sourcecode and lead to effects like you mentioend above.
Your HTML is not valid and this is causing unexpected behaviour.
The very first problem is the following
Resulting in 2
<html>
elements, the second of which even defines a different parse behaviour to the DOCTYPE (because the unexpected second tag means you’re now in quirks). Once this is fixed the other error messages should make more sense.Additionally you are not sending any charset data with the .js files, whilst the page does have a charset defined ( utf-8 ) and this may cause an encoding conflict.