jQuery与这些JavaScriptDOM对象/方法的等价物是什么?
我试图找出jQuery与以下代码的等价性:jQuery与这些JavaScriptDOM对象/方法的等价物是什么?,javascript,jquery,dom,Javascript,Jquery,Dom,我试图找出jQuery与以下代码的等价性: var temp = $('#logoutFrame2').contents().find('html').html(); try { var temp1 = document .getElementById('logoutFrame2') .contentWindow .document
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 = $('#logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
}
catch(err){}
$('#theContacts').append('<div>'+temp+'</div>');
var temp=$('#logoutFrame2').contents().find('html').html();
尝试
{
var temp1=$('logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
}
捕获(错误){}
$(“#联系人”)。附加(“”+temp+“”);
享受吧
转化为
var temp = $('#logoutFrame2').contents().find('html').html();
try
{
var temp1 = $('#logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
}
catch(err){}
$('#theContacts').append('<div>'+temp+'</div>');
var temp=$('#logoutFrame2').contents().find('html').html();
尝试
{
var temp1=$('logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
}
捕获(错误){}
$(“#联系人”)。附加(“”+temp+“”);
享受吧 您希望将这段代码的哪一部分更改为jquery?所有代码都需要临时变量,因为我已经做了那一部分。您希望将这段代码的哪一部分更改为jquery?所有代码都需要临时变量,因为我已经做了那一部分。