Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-26-2012, 01:33 PM   PM User | #1
sourabh1989
New Coder

 
Join Date: Jul 2012
Posts: 20
Thanks: 3
Thanked 0 Times in 0 Posts
sourabh1989 is an unknown quantity at this point
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..
sourabh1989 is offline   Reply With Quote
Old 09-26-2012, 02:12 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
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?
devnull69 is offline   Reply With Quote
Old 09-26-2012, 02:32 PM   PM User | #3
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,379
Thanks: 3
Thanked 466 Times in 453 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
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.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:06 AM.


Advertisement
Log in to turn off these ads.