简体   繁体   中英

What is the jQuery equivalent to these javascript DOM objects/methods?

I am trying to figure out what would be the jQuery equivalent to the following code:

 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);

Any help would be great! :o)

David

    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);

translates to

 var temp = $('#logoutFrame2').contents().find('html').html();

    try
    {
        var temp1 = $('#logoutFrame2')[0].contentWindow.document.getElementById('theCBOBox').innerHTML;
    }
    catch(err){}

    $('#theContacts').append('<div>'+temp+'</div>');

Enjoy!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM