I want to add Doctype to an iframe once its loaded. I have tried the following script without any luck:
$(document).ready(function(){
$('.ms-dlgFrame').ready(function(){
var iframe = $('.ms-dlgFrame');
var newHTML = "<!DOCTYPE html><html>"+iframe.contents().find('html').html()+"</html>";
iframe.contents().find('html').html(newHTML);
//iframe.contents().prepend('<!DOCTYPE html>');
});
});
Seems its a simple thing but I am doing a mistake.