Jump to content
Larry Ullman's Book Forums

Internet Explorer Issue


Recommended Posts

Hello,

I'm having a bit of an unusual problem and I've spent hours trying to figure it out with no luck. I downloaded the scripts and then made a copy of them. In going through the exercises I open a sample file with Notepad ++ and delete the code but leave the comments. I then fill in the code after reading the book, Then I compare my script to the original and fix any mistakes I've made.

 

My exercises work in Firefox and Chrome but when I test in Internet Explorer two exercises have not. The Explorer console gives me the following error: SCRIPT1014: Invalid character random.js, line 1 character 1. The script is identical to the original. Here's where it gets really weird, if I put the unaltered script in the js folder it works however even if I copy and paste the content of the unaltered script into the script I was working with I still get the error. I deleted the browsing history, I changed the path, I even restarted my computer and no luck. If anyone has any ideas as to what may be going on here I would appreciate them very much. Thanks!

 

Paul

Link to comment
Share on other sites

I changed the encoding to UTF8 (with and without BOM), deleted the browsing history and still got the same error. I then downloaded Aptana Studio. I created a new Javascript file in Aptana, copied and pasted the code from the unaltered file and received the same results, works in Firefox and Chrome, error in Explorer. Do you have any other suggestions? Thanks!

Link to comment
Share on other sites

The script does not involve any server based code. There have been several scripts giving me issues the last two are chapter 5 random and chapter 6 today. This time the unaltered .js file works in all browsers. As soon as I save it, it no longer works in any version of Explorer. In Notepad++ there is an encoding menu item. I selected convert to UTF-8 and saved the files. They are still not working in Explorer. I also tried to create a new file using Aptana Studio and no luck. I am stumped. Any other suggestions would be very much appreciated. Thank you.

Link to comment
Share on other sites

It seems after much agony I have finally got my scripts to work in Explorer. Just changing the encoding under the encoding drop down and saving the file was not enough. I needed to change the default encoding settings (under settings>preferences>new document) to UTF8 without BOM. I tried a bunch of things but I think this was the solution.

Link to comment
Share on other sites

 Share

×
×
  • Create New...