www.webdeveloper.com
Results 1 to 2 of 2

Thread: entering javascript language version gives syntax error in IE8

  1. #1
    Join Date
    Jul 2010
    Posts
    7

    entering javascript language version gives syntax error in IE8

    Basically, the script is an onMouseover slideshow which works fine.

    The problem is that in internet explorer, it says there is a syntax error relating to the javascript code. (this doesn't appear on chrome or firefox)

    here is the code:

    Code:
    <script>
    <script language="JavaScript1.1">
    var myimages=new Array()
    var gotolink="#"
    
    </script>
    basically, by putting the script language here, IE8 is saying there is a syntax error! removing it stops the error but stops the script from working.

    What can I do here? If I put it in an external .js file instead (right now it is in the head of the HTML page) will this solve the problem?

    P.S im a total newbie to javascript so apologies if this is a daft question

    thanks in advance

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    The normal way to include JavaScript now is either by an external file or with the type attribute.
    Code:
    <script src="address/of/js/file.js">
    <script type="text/javascript">
    // Your JavaScript
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles