Is there a way to introduce Internet Explorer conditional comments using JavaScript?
问题 I have a segment of HTML code which includes a conditional comment: <!--[if IE]> <link rel="stylesheet" ...> <[endif]--> This code was tested and works correctly when included in the HEAD section of the page, on the initial page rendering. I would like to introduce the same conditional CSS to an existing page using JavaScript in an Ajax response. I have tried: var comment = document.createComment("[if IE]>\n<link rel=\"stylesheet\" ...>\n<[endif]"); Wicket.Head.addElement(comment); //this is