SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Internet Explorer frameborder Bug

    Hello,

    How can I set 'frameborder' attribute in ie? I tried this but didn't work:

    var foo = document.createElement("iframe");
    document.body.appendChild(foo);
    foo.setAttribute('frameborder','0');

    thanks..

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:

    foo.frameborder = 0;

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried this, not working.

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    foo.frameBorder = 0;

  5. #5
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it isn't working too.

  6. #6
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot, i solved the problem.

    var foo = document.createElement("iframe");
    foo.frameBorder = 0;
    document.body.appendChild(foo); // we should locate this line after defining frameborder .

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    // we should locate this line after defining frameborder .
    Hmm...that was my original thought, but I dismissed it.
    Does this work for you in IE:
    Code:
    window.onload = function()
    {
    	var x = document.createElement("div");
    	var y = document.createTextNode("goodbye");
    	x.appendChild(y);
    	document.body.appendChild(x);
    	x.style.color="blue";
    }
    As for this:
    Code:
    foo.frameBorder = 0
    I wouldn't have expected the camel case syntax because the property is frameborder not frame-border. Now, I see the note on msdn that says you need to use frameBorder for scripting.


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
  •