SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    IE7 crashes on element creation

    I have a page which causes IE7 to error with "Internet explorer cannot open the Internet site [url] Operation aborted." then go to its default error page.

    Problem is it's already displayed 90% of the page at that point, and it's a fairly simple piece of JavaScript that's causing the crash. Put in a blank page, it causes no harm.

    Code:
    <script type="text/javascript">
    //<![CDATA[
    	var vd = document.createElement('div');
    	vd.style.display = 'none';
    	vd.style.position = 'absolute';
    	vd.style.top = '200px';
    	vd.style.left = '200px';
    	vd.style.backgroundColor = '#fff';
    	vd.style.zIndex = '1000';
    	vd.style.width = '400px';
    	vd.style.border = '1px solid #000';
    	vd.style.textAlign = 'left';
    	vd.id = 'visitor_detail';
    	document.body.appendChild(vd);
    
    //]]>
    </script>
    I can't figure out why, I hope someone else can. Sorry to link to it, but I can't reproduce it outside the actual page it happens on:

    [Removed my link to a crashing page]

    Also, the error persists if I remove all the properties and just append an empty div.

    If anyone can help me figure out why creating this div crashes the browser, I'd be very happy. I did so to fix a display bug in Safari when I just had a <div> with styles after all.
    Last edited by Dan Grossman; Oct 17, 2007 at 01:15.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks stereofrog. All fixed up.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •