View Full Version : JS Error: Expected ']'

07-28-2010, 07:13 AM
Hi There,
I am trying to import a java script to my html page as below

<script type="text/javascript" src="URL_OF_JS"></script>

However I am getting the error on page in IE6 as:

Error: Expected Ď]í

The JS file which is being including is basically a third party js which has map related code. I even downloaded the JS and gave static import then to it didnít help. The same code is working with other browser including IE7/8.

My deployment environment has CentOS 5.2 and Apache 2.2.3.

Any thoughts would be appreciated.

07-28-2010, 08:27 AM
this is an error coming from Javascript. there’s nothing wrong with the HTML that’s calling it. you may consider dropping support for IE6 unless you have a big enough user base there.

07-28-2010, 08:48 AM
Thanks for reply however we have to support IE6 so could you suggest something to fix this.

07-28-2010, 09:05 AM
the obvious thing would be to find the error. although that may prove difficult, if other browsers don’t see that error.

07-28-2010, 10:05 AM
One more strange behavior which I noticed is code works fine with IE6 when deployed on Debian linux Server with Apache 2.2.9. But I want it work for CentOS.

Any thoughts...

07-28-2010, 02:16 PM
Sounds like it's a server configuration thing rather than a JavaScript thing then.

Just a guess but perhaps it doesn't like empty tags, I had a similar problem recently:


<script type="text/javascript" src="URL_OF_JS"> &.#.160; </script>

removing the "."s between & and #

12-24-2010, 07:15 AM
Hi All,

I solved it long back, just want to post the solution here so that it will help other who might same issue.

The solution is simple when importing the the Javascript file specify the character encoding as below:

<script charset='iso-8859-1' type='text/javascript'

The issue was few of chars were grave accent characters and
some special characters in that JS file. Although modern browser support those automatically however for IE6 we need to specify charset='iso-8859-1' .

Hope it will help !!