在Javascript中追加一次

Appending Once in Javascript

本文关键字:一次 Javascript 追加      更新时间:2023-09-26

如何将以下代码追加一次:

$('.faq_info').append(
                            '<ul>' +
                            '<li>Highlighted code for double html, body, and head tags means its invalid.</li>' +
                            '<li>Check highlighted iframe tags if it effects link placement.</li>' +
                            '<li>Highlighted charset means its not UTF8 or it is a bad charset.</li>' +
                            '<li>Highlighted symbols means that they are effecting the link.</li>' +
                            '<li>Check highlighted comments if it effects the link placement.</li>' +
                            '<li>If client url is highlighted it means something else in the source is causing it to be invalid.</li>' +
                            '<li>Check to see if client url is in the source code.</li>' +
                            '</ul>'
                        );

我刚刚做了以下$('div.faq_info').empty().append('hatever string');它是有效的。它基本上清空div中的所有内容,并在后面追加。