J.J.Baxter - My place on the web - interests, hobbies, thoughts & ruminations
Home / Blog
Books
Links
Images
Aug Sep-2010 Oct
SMTWTFS
2930311234
567891011
12131415161718
19202122232425
262728293012
3 4 5 6 7 8 9
Reset Calendar
Snorg Girls
Programming Tips
Sherlock Holmes
Mythbusters
Gallipoli
Nova Science Now
Ajax Loading Images
The Girls of Dr. Who
Keratosis Pilaris (KP)
Amazing Water
Buy me a drink? I'll have a Cappuccino, thanks.
Random Images
Random Link
Tahlei's PhotoBlog
Random Book
The Bourne Ultimatum
by Robert Ludlum






All Rights Reserved 2008
JJBaxter.com

J.J.Baxters Development Tips & Snippets
backBack
 Resetting the window.onerror trap (JavaScript : 22-Feb-2009)
This took far to long to find. I use window.onerrr=null to disable javascript errors where I knew they would occur (and it didnt matter) but it took me 20 minutes to find how to reset it back to normal. Here is what you do:

function autofitIframe(id) {
    window.onerror=null; // disable errors caused by cross-domain scripting
    if (!window.opera && !top.document.mimeType && top.document.all && top.document.getElementById) {
       top.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
    } else {
       if(document.getElementById)
          top.document.getElementById(id).style.height=this.document.body.scrollHeight+"px";
    }
    window.onerror = window.defaultOnError; // restore default handler
}
Ref Link: http://www.faqts.com/knowledge_base/view.phtml/aid/1067