Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Syntax error?

New Here ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

Dreamweaver is telling me there's a syntax error, and yet I see no errors around the line.

This is the part of the page

<script type="text/javascript">

    function logout(){

    document.forms["logoutform"].submit();

    }

   

    function openMail(){

        window.open("/mail.php","mailer","menubar=no,toolbar=no,height=360,width=485");

    }

   

    //Preload

    function preload() {

              for (i = 0; i < preload.arguments.length; i++) {

                        images = new Image()

                        images.src = preload.arguments

              }

    }

    preload("/tabHover.png");

    </script>

-->DREAMWEAVER SHOWS ERROR IS ON THIS BLANK LINE<--

    <style type="text/css">

Why does it say there is a error there? If I take the > off of </script> it says there's no error.

TOPICS
Server side applications

Views

1.2K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

You are missing line terminators in your for loop.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

Ah, good find, however I fixed that and it still says syntax error.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

I fixed one other error (images was not defined) and it runs fine in the browser, but dreamweaver still says there's a syntax error.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

Even if I comment everything out inside the script block it still says there's a syntax error.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

Sometimes the syntax checker gets a little tired.

Usually, the error message goes away if you save the file, close it, and reopen it.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2012 Jul 13, 2012

Copy link to clipboard

Copied

LATEST

Hm... I tried closing and opening it, and even closing and opening dreamweaver, and I still get the error message. I'm sure I'm doing something dumb... does having a HTML5 document make a difference?

    <script type="text/javascript">

    function logout(){

    document.forms["logoutform"].submit();

    }

    function openMail(){

        window.open("/mail.php","mailer","menubar=no,toolbar=no,height=360,width=485");

    }

    //Preload

          var images = new Array();

    function preload() {

              for (i = 0; i < preload.arguments.length; i++) {

                        images = new Image();

                        images.src = preload.arguments;

              }

    }

    preload("/tabHover.png");

    </script>

-->THIS IS THE LINE IT MARKS THE ERROR ON<--

    <style type="text/css">

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines