The dynamic loading of CSS is used today, but the following dynamic calling cannot be correctly loaded in IE. Of course, it is normal in Firefox and chrome.
$(function(){ var linkTmp = $('<link rel="stylesheet" type="text/css" />'); linkTmp.attr({ 'href':'source/uploadify/resource/uploadify.css' }); $('head').eq(0).append(linkTmp);})
At that time, I checked the HTML and found that this statement was successfully inserted in the head.
<LINK rel = "stylesheet" type = "text/CSS" href = "Source/uploadify/resource/uploadify.css"/>
But why does ie not dynamically load it?
Here is a classic explanation:
Once IE has processed all the styles loaded with the page, the only reliable way to add another stylesheet is with document. createstylesheet (URL)
Modify the Code as follows to load it successfully!
url ='style.css';if(document.createStyleSheet){ document.createStyleSheet(url);}else{ var linkTmp = $('<link rel="stylesheet" type="text/css" />'); linkTmp.attr({ 'href':'source/uploadify/resource/uploadify.css' }); $('head').eq(0).append(linkTmp);}