Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS Error: Expected ']'

    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.
    Thanks!
    KK

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,250
    Thanks
    12
    Thanked 340 Times in 336 Posts
    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.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for reply however we have to support IE6 so could you suggest something to fix this.

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,250
    Thanks
    12
    Thanked 340 Times in 336 Posts
    the obvious thing would be to find the error. although that may prove difficult, if other browsers don’t see that error.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #5
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #6
    New Coder
    Join Date
    Feb 2005
    Posts
    97
    Thanks
    7
    Thanked 7 Times in 7 Posts
    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:

    try:

    Code:
    <script type="text/javascript" src="URL_OF_JS"> &.#.160; </script>
    removing the "."s between & and #

  • #7
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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'
    src='YOUR_JS_FILE'></script>

    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 !!

    -KK


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •