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

Syntax error?

New Here ,
Jul 13, 2012 Jul 13, 2012

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
1.2K
Translate
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

You are missing line terminators in your for loop.

Translate
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

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

Translate
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

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.

Translate
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

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

Translate
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

Sometimes the syntax checker gets a little tired.

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

Translate
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
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">

Translate
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