次の JavaScript コードは eBay Partnernetwork から提供されており、HTML ファイルでは問題なく動作しますがecho()
、PHP スクリプトで実行しようとすると、正しく解析されません。
コードは次のとおりです。
<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>
の引用符に問題があると思いますがdocument.write("...");
、何を試してもうまくいきません。私はそれらをエスケープし、16進コードに置き換えましたが、成功しませんでした.