![](/img/trans.png)
[英]What is the DOM/Vanilla Javascript equivalent of jquery's .is(':empty')
[英]What is the jQuery equivalent to these javascript DOM objects/methods?
我試圖弄清楚什么是與以下代碼等效的jQuery:
var temp = $('#logoutFrame2').contents().find('html').html();
try {
var temp1 = document
.getElementById('logoutFrame2')
.contentWindow
.document
.getElementById('theCBOBox').innerHTML;
}
catch(err){}
var newdiv = document.createElement("div");
newdiv.innerHTML = temp;
var container = document.getElementById("theContacts");
container.appendChild(newdiv);
任何幫助將是巨大的! :o)
大衛
var temp = $('#logoutFrame2').contents().find('html').html();
try {
var temp1 = document
.getElementById('logoutFrame2')
.contentWindow
.document
.getElementById('theCBOBox').innerHTML;
}
catch(err){}
var newdiv = document.createElement("div");
newdiv.innerHTML = temp;
var container = document.getElementById("theContacts");
container.appendChild(newdiv);
轉換為
var temp = $('#logoutFrame2').contents().find('html').html();
try
{
var temp1 = $('#logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
}
catch(err){}
$('#theContacts').append('<div>'+temp+'</div>');
請享用!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.