【问题标题】:Jquery generate extra code in wordpressJquery 在 wordpress 中生成额外的代码
【发布时间】:2014-06-30 07:51:05
【问题描述】:

我的代码

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="">

哇,我能解决这个问题吗?任何人都可以请。提前致谢。

【问题讨论】:

    标签: javascript php wordpress


    【解决方案1】:

    像这样改变你的脚本

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

    【讨论】:

    • type='text 结束语在哪里?
    • 好的,现在再次检查一下,我已经按照您的方式更改了您的代码
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    相关资源
    最近更新 更多