I have an iFrame that is generated through some javascript on my page, prior to jQuery 1.9 I was using a simple check to see if internet explorer was being used and added some attributes required to make the iframe render properly in ie7 and ie8. Which of course these attributes are no longer valid, and I would prefer not to have invalid code in my HTML unless it absolutely necessary, so they are only applied to ie8 and below.
var ieOldAttr = " ";
if ($.browser.msie && parseInt($.browser.version, 10) <= 8) {
ieOldAttr = "allowTransparency=\"true\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" ";
}
//Generate iFrame here
pageOutput += "<iframe id=\"feedbackiFrame\" src=\"URLHERE\"" + ieOldAttr + "style=\"border: none; overflow: hidden; height: 540px; width: 415px; position:absolute; left: 5px; top: 5px;\"><\/iframe>";
$(document).ready(function () {
$(pageOutput).appendTo(document.body);
});
In jQuery 1.9 they deprecated .browser
, they instead suggest to use modernizer, but I dont think that modernizr would be able to accomplish what I need it to do here. Is there a way that I dont know about in modernizr to be able to detect this and correctly render the iFrame or do I need to do some pure javascript to detect the browser then apply it to the iFrame.