当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Jquery generate extra code in wordpress

问题描述:

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>";
分享给朋友:
您可能感兴趣的文章:
随机阅读: