问题描述:

My code

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);

Output:

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

Why generate this extra?

<="" script="">

Wow can I solve this. Any one can please. Thanks in advance.

网友答案:

Change your script like this

google_ad_client = "<script type='text/javascript'>google_ad_client =\'" +google_ad_client+"'</"+"script>";
相关阅读:
Top