I tried to add a conditional statement for IE7 with jQuery, but it doesn’t work dynamically (if it was hardcoded it worked, so I know this is related to the way jQuery is appending the actual “comment” of the conditional statement).
The code I’m using is this:
$("head").append("<!--[if IE 7]>");
$("head").append("<link>");
css = $("head").children(":last");
css.attr({
rel: "stylesheet",
type: "text/css",
href: "css/IE7.css"
});
$("head").append("<![endif]-->");
My thought is that this is related to the < and >, maybe these need to be urlencoded?, how?
Anyone have a solution for this that doesn’t involve targeting each CSS property with jQuery (there are tens of CSS fixes, so that won’t be a solution).
You could use
$.browserto check the browser version and act accordingly: