当它被PHP回复时,我无法让这个Javascript工作[重复]

This question already has an answer here:

The following javascript Code is provided by eBay Partnernetwork and it works well in a HTML file, but when I try to echo() it in a PHP script, it's not parsed correctly.

Here's the code:

 <script type='text/javascript' src='http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js'></script>
 <script type='text/javascript' src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
 <script charset='utf-8' type='text/javascript'>
 document.write("\x3Cscript type='text/javascript' charset='utf-8' src='http://adn.ebay.com/cb?programId=11&campId=XXX&toolId=10026&keyword=Huawei+MediaPad+3G&sortBy=4&width=180&height=60&font=1&textColor=333366&linkColor=333333&arrowColor=FF9900&color1=6599FF&color2=[COLORTWO]&format=ImageLink&contentType=TEXT_AND_IMAGE&enableSearch=y&usePopularSearches=n&freeShipping=n&topRatedSeller=n&itemsWithPayPal=n&descriptionSearch=n&showKwCatLink=n&excludeCatId=&excludeKeyword=&catId=171485&disWithin=200&ctx=n&autoscroll=n&title=Odys+Noon&flashEnabled=' + isFlashEnabled + '&pageTitle=' + _epn__pageTitle + '&cachebuster=' + (Math.floor(Math.random() * 10000000 ))'>\x3C/script>" );
 </script>

I think there's a problem with the quotes at document.write("..."); but whatever I try, it doesn't work. I escaped them and also replaced them with hex code, but with no success.

</div>

have you tried document.write("<scr"+"ipt src=blahblahblah></scr"+"ipt>");

Try this

<?php
    $str = <<<EOF
 //your script here --->(1)
EOF;
    echo $str;
?>

Note : the EOF; alignment is important(leftmost), try to type this in a better ide or atleast Notepad++!

update:

Note : No more escaping inside --->(1) like in your script