document.ready() not triggered after ajax request in IE but work a charm in FF and chrome. I have two files. First file(test.jsp) just has a submit button. onclick it loads from struts the second file(result.jsp). . the two files are
test.jsp
<html>
<head>
<script type="text/javascript" src="/js/jquery-1.2.6.min.js"/></script>
<script type="text/javascript" src="/js/api.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#test").click(function()
{
var path = "/TestAjax.do"
$.get(path,function(data)
{
document.write(data);
});
});
});
</script>
</head>
<body>
<div><h3>Hello World</h3><br/>
<input type="button" id="test" value="submit"/>
</div>
</body>
</html>
result.jsp
<html>
<head>
<script type="text/javascript" src="/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert("success");
});
</script>
</head>
<body>
<div><h3>result</h3><br/>
<!--input type="button" id="test" value="submit"/-->
</div>
</body>
</html>
when result.jsp loads alert("success"); is called.... This works well in FF and chrome. But not in IE. the alert doesnt pop up. Displays error as Object expected i document.ready() line. But works if we refresh the page....
Any help will be appreciated...