Problem with $dom->saveHTML();

From: Date: Wed, 23 Nov 2011 12:08:31 +0000
Subject: Problem with $dom->saveHTML();
Groups: php.qa 
Request: Send a blank email to php-qa+get-65987@lists.php.net to get a copy of this message
Hi, I am running php 5.3.5 and have got a problem with $dom->saveHTML(); It moves the </script> tag from end of script block to middle of it. See below: Partial Source as it is when loading it: <script type='text/javascript'>
     //cto listing tag
     document.write('<div id="cto_se_7714219_ac" style="display:none">');
     document.write('<div
class="ctoWidgetServer">http://lasenzauk.widget.criteo.com/pjl/</div>');
     document.write('<div class="ctoDataType">sendEvent</div>');
     document.write('<div
class="ctoParams">wi=7714219&pt1=3&i1=030013744&i2=030013745</div>');
     document.write('</div>');
</script> Partial Source after using $dom->saveHTML(); <script type="text/javascript">
     //cto listing tag
     document.write('<div id="cto_se_7714219_ac" style="display:none">');
     document.write('<div
class="ctoWidgetServer">http://lasenzauk.widget.criteo.com/pjl/</script></div>');
     document.write('<div class="ctoDataType">sendEvent</div>');
     document.write('<div
class="ctoParams">wi=7714219&amp;pt1=3&amp;i1=030013744&amp;i2=030013745</div>');
     document.write('</div>');
I am using
            $dom = new domDocument;
            @$dom->loadHTML($sContent);
Where $sContent is the Full source of the web page. Regards Kirsten

« previous php.qa (#65987) next »