...

View Full Version : FF (and IE) has "illegal character" error in Error Console



loamguy1
06-21-2010, 04:54 PM
Strange problem here... I'm implementing google's JS tracking code verbatim which determines whether or not the current site is using HTTP or HTTPS. It builds a dynamic URL used as the "SRC" parameter in the SCRIPT statement.

On browsers I'm testing with(FF, IE, Chrome) there's no problem running the code.

However, there are some people in the office who get an FF or IE error (same versions as mine) on the URL as the SRC parameter. The error, in the FF Error Console, is this:


illegal character
http://www.google-analytics.com/ga.js
? ? ? ? --> question marks appear in console

I can't figure it out since I can't create this error on any of my browsers.

Could this be related to something like browser security settings or add-ons?

linjaaho
07-09-2010, 11:11 PM
However, there are some people in the office who get an FF or IE error (same versions as mine) on the URL as the SRC parameter.

I had the same problem, and the reason was that the page was saved using encoding utf-16 while it should be utf-8. You can check the encoding by viewing page info by hitting CMD+i (on a Mac).

Here is an example of wrong encoding (while writing this):

http://4.bp.blogspot.com/_VsGSScniKZU/TDedG1bb23I/AAAAAAAAAR0/rv0C1JImm1s/s1600/google+analytics+illegal+character.png

Save the file with utf-8 and it will work.

I think this is Google's or Firefox's bug. On IE and Safari it seems to work even with utf-16.

loamguy1
07-12-2010, 07:18 PM
Thanks for the post. Unfortunately, the encoding is correctly being saved as UTF-8, but the problem still exists in office computers (IE, FF).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum