Re: <script> gets deleted

Hello Keith,

> I am running Amaya 9.51 on Windows XP. I have some HTML pages that use 
> the Javascript document.write() function to generate rows in a table. My 
> page looks something like this:


> The problem is that when I read this page into Amaya, then save the 
> file, everything inside the table from the <script> to the </script> is 
> deleted!

> This page (as above) renders perfectly in Netscape, Firefox, and 
> Micro$oft Internet Explorer. However, Amaya does not seem to like a 
> <script> inside the table. Javascript allows me to generate any document 
> content, including table rows, using document.write(). Why doesn't Amaya 
> allow <script> inside <table>?

The problem is that the element <script> is not accepted between <tr> according to the HTML DTD, so the document is invalid.
You can see that in the Show Parsing Error window : 'Tag <script> is not allowed here (removed when saving)'
One goal of Amaya is to produce valid HTML documents, it's the reason why this element is removed.

One solution would be to save this element elsewhere in the document where it is allowed so that it won't be lost. 

  Laurent Carcone              W3C/ERCIM
  +33 (0)4 76 61 52 67        INRIA Rhône-Alpes, 655 Avenue de l'Europe
                              38334 Saint Ismier Cedex - France

Received on Wednesday, 3 May 2006 08:31:15 UTC