views:

45

answers:

1

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

+1  A: 
    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!

Bogdan Constantinescu
That worked, Bogdan :o) Thanks!
StealthRT