StealthRT
StealthRT

Reputation: 10552

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

Upvotes: 1

Views: 584

Answers (1)

Bogdan Constantinescu
Bogdan Constantinescu

Reputation: 5356

    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!

Upvotes: 1

Related Questions