Re: DOMDocument throws Unexpected end tag error when loading valid HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 6 Jun 2010 13:56:25 -0500, Raymond Irving wrote:

> Here's the script. Can anyone confirm this error or is there a known
> workaround?
> 
> <?php
> 
> $html = '
> <!DOCTYPE html>
> <html>
>     <head>
>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>         <script type="text/javascript">
>             var html = "<strong>Bold Text</strong>,Normal Text";
>             document.write(html);
>             alert(html);
>         </script>
>     </head>
>     <body> </body>
> </html>
> ';

In HTML, the "</" sequence closes the <script> element.
You can escape the "/" character with a backslash:

    <strong>Bold Text<\/strong>,Normal Text


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux