“Object expected” error in IE. when using $(document).ready(function()
To fix this
check the jquery script tag , if it is like
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
replace it like
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
and the error goes away
why IE gives the error on type=”text/javascript” i really do not know
if any one know the reason do let me know
I got the same problem but when I load html content to an iframe. I tried your solution but still not work
Code loading html content to iframe:
$.ajax({
url: proxyBEUrl,
type: ‘POST’,
//jsonp: ‘callback’,
dataType: ‘text’,
data: { … },
success: function (result) {
$(‘#frame-content’).ready(function () {
var content = result;
var doc = $(‘#frame-content’)[0].contentWindow.document;
doc.open();
doc.write(content);
doc.close();
});
}
});
adayimportant@yahoo.com (TMDUng)