我正在为一个本身没有 HTML 的第 3 方应用程序换肤。这一切都来自 onLoad 事件和一堆 ajax 调用。
我将 jQuery 添加到页面中。我需要wrapp()一个动态加载的元素。如果需要,我可以添加一个插件。
我该怎么做?谢谢。
更新: 这可行,但是有更好的方法吗?
$(document).ready(function() {
(function() {
var length = $(".applicationShell").length;
var h = setInterval(function () {
if ($(".applicationShell").length > length) {
length = $(".applicationShell").length;
clearInterval(h);
$(".applicationShell").addClass("test")
}
}, 100);
})();
});
请您参考如下方法:
嗯,看来我找不到更好的解决方案了。 :( 这是我用过的。
$(document).ready(function() {
(function() {
var length = $(".applicationShell").length;
var h = setInterval(function () {
if ($(".applicationShell").length > length) {
length = $(".applicationShell").length;
clearInterval(h);
$(".applicationShell").addClass("test")
}
}, 100);
})();
});
