Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to load css (dynamically) in Safari

Status
Not open for further replies.

jaschulz

Programmer
May 20, 2005
89
FR
The function below works fine in FF, IE and Opera. But it does not work in Safari. Is there a work-around for this problem?

thanks,

JAS

function loadStyles() {
var oLink = document.createElement('link')
oLink.href = './CSS/myStyles.css';
oLink.rel = 'stylesheet';
oLink.type = 'text/css';
oLink.media = 'screen';
document.body.appendChild(oLink);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top