附加符号,jquery 显示无效符号

Append symbol with jquery showing invalid symbol

本文关键字:符号 显示 无效 jquery      更新时间:2023-09-26

我试图附加一个包含此符号的文本:» 但由于某种原因它不适用于 JQuery。有什么解决方法吗?

脚本:

    jQuery(document).ready(function () {
    jQuery('.six .ovh .entry-content a').hide();
jQuery('.six .ovh .entry-content').each(function() {
    var href   = jQuery(this).prev('header').find('h2 > a').attr('href'),
        anchor = jQuery('<a />', {href: href, text: ' Continue reading »'});
//    jQuery(this).append(anchor);
    jQuery('p:last-child', this).append(anchor);
});
    });
</script

这是它如何显示的:

继续阅读

将»替换为&raquo;你应该很好

问题

解决了,我只是将锚变量从文本更改为html