Skip navigation
taters5
Currently Being Moderated

"There is a syntax error on line 18."

Aug 10, 2012 7:19 PM

I'm not sure why I'm getting this error. I'm getting it where I have an optional, editable region.

 

Can any one else see it? Here's the code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/screen.dwt" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>Website</title>

<!-- InstanceEndEditable -->

<link href="../../css/desktop.css" rel="stylesheet" type="text/css" media="screen" />

<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->

<!-- InstanceParam name="breadCrumbs" type="boolean" value="false" -->

<script type="text/javascript">

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

</script> <!-- Here is line 18, where the error pops up... a script error I suppose? -->

</head>

 

Can any one else see the error?

 
Replies
  • Currently Being Moderated
    Aug 11, 2012 5:26 AM   in reply to taters5

    I don't know much about this but if you use the CDATA thingy, the code will validate:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <!-- InstanceBegin template="/Templates/screen.dwt" codeOutsideHTMLIsLocked="false" -->

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!-- InstanceBeginEditable name="doctitle" -->

    <title>Website</title>

    <!-- InstanceEndEditable -->

    <link href="../../css/desktop.css" rel="stylesheet" type="text/css" media="screen" /><!-- InstanceBeginEditable name="head" -->

    <!-- InstanceEndEditable -->

    <!-- InstanceParam name="breadCrumbs" type="boolean" value="false" -->

     

    <script type="text/javascript">

    //<![CDATA[

     

    function MM_preloadImages() { //v3.0

     

      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

     

        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

     

        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

     

    }

     

    //]]>

    </script>

    </head>

     

    I think that all it does is make it clear to the browser that the code is not XHTML and prevents it from being parsed.  Another way to get around it is to put your script in an external file.

     

    I'm not sure that it matters that much but we might get an expert to give an opinion.

     

    Martin

     

    http://stackoverflow.com/questions/7092236/what-is-cdata-in-html

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points