2014-06-30 31 views
-1

我的代碼額外的代碼jQuery的產生在WordPress

var google_ad_client = this.title;   
google_ad_client = google_ad_client+"';"; 
google_ad_client = "<script type='text/javascript>google_ad_client =\"" +google_ad_client+"</"+"script>"; 

jQuery('#addSpace').html(google_ad_client); 

輸出:

<script type="text/javascript>google_ad_client =&quot;ca-pub-1702577941194110" ;<="" script=""></script> 

爲什麼產生這種額外的?

<="" script=""> 

哇,我可以解決這個問題。任何人都可以請。提前致謝。

回答

0

改變你這樣的腳本

google_ad_client = "<script type='text/javascript'>google_ad_client =\'" +google_ad_client+"'</"+"script>"; 
+0

這哪裏是'類型='text'最終報價? – Ranjith

+0

添加結束引用 – Sid

+0

我先試試這種方式。它不工作! –