Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    href not working in IE8 but working fine in firefox..

    I have dynamically created href in javascript which works absolutely fine in firefox but shows error in chrome and IE8.

    Code:
    var file_name= "www.google.com";
    var link=document.createElement('link');
    link.setAttribute('href' , file_name);
    link.appendChild(document.createTextNode(argument[i]));
    td.appendChild(link);
    Any suggestions will be very helpful... Thanx in advance..

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    You want to create a <link> element inside a td (supposedly)?? What would be the purpose of that?

    Did you maybe want to create an <a> anchor tag instead?

  • #3
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,513
    Thanks
    3
    Thanked 504 Times in 491 Posts
    Code:
    var file_name= "www.google.com";
    var link=document.createElement('A');
    link.setAttribute('href' , file_name);
    link.appendChild(document.createTextNode(argument[i]));
    td.appendChild(link);
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Tags for this Thread

    Posting Permissions

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