Jump to content

Validator Help (simple Question)


scubadesign

Recommended Posts

Hi,Im trying to validate some of my pages but i cant remember how to hide code from the validator. I was lazy and made a form using coffee cup form maker and get a load of errors when validating just dew to the script with it. i need to have the form show in the browser but dont know how to hide it from the validator.below is the code i need to hide and display.

<script type="text/javascript" src="swfobject.js"></script><div id="CC4409241">Form Object</div><script type="text/javascript">var so = new SWFObject("myform.swf", "myform.xml", "350", "350", "7,0,0,0", "#ffffff");so.addParam("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");so.addParam("quality", "high");so.addParam("scale", "noscale");so.addParam("salign", "lt");so.addParam("FlashVars", "xmlfile=myform.xml&w=350&h=350");so.write("CC4409241");</script>

Link to comment
Share on other sites

Link to your script: save it as a .js file, without the opening and closing script tags, and link like this:<script language="javascript" src="wherever_your_file_is.js"></script>

Link to comment
Share on other sites

If your page is XHTML, you have to put the script in <[![CDATA]]> tags:

<script type="text/javascript">//<[![CDATA  /* Some code here *///]]></script>

Link to comment
Share on other sites

Originally it was <!--// //--> not <!-- -->I now use the below method, which I got from http://www.giantisland.com/Resources/JavaS..._and_CDATA.aspx

<script type="text/javascript"><!--//--><![CDATA[//><!--JavaScript Code goes here//--><!]]></script>

but this now seems to been updated to

<script type="text/javascript">  /*<![CDATA[*//*---->*/   JavaScript Code goes here  /*--*//*]]>*/  </script>  

Link to comment
Share on other sites

I don't put comments around my code, normally. It's only necessary in XHTML, because some of the characters are parseable by XML. I recommend using external scripts when possible.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...