...

View Full Version : href not working in IE8 but working fine in firefox..



sourabh1989
09-26-2012, 02:33 PM
I have dynamically created href in javascript which works absolutely fine in firefox but shows error in chrome and IE8.



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..

devnull69
09-26-2012, 03:12 PM
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?

vwphillips
09-26-2012, 03:32 PM
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);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum