While loading AJAX content that includes a javascript function using the jQuery .load function with done() on completion, I am facing an issue.
$('#content').load(a, done);
function done()
{
if(pagejs() == 'function')
{
pagejs();
}
}
My problem arises in IE 9 where the script does not execute as expected, resulting in a SCRIPT5007: Object expected error. This occurs at the if(pagejs() == 'function')
line, while FF and Chrome handle it correctly.
Even after adding the compatibility meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
, the issue persists.
For reference, here is a snippet of the AJAX content:
<div id="about"><h1>About This Website</h1>
<script type="text/javascript">
function pagejs(){alert('content was loaded from dynamic script');}
</script>
<p>This is test AJAX content</p>
In IE, the pagejs();
function is considered undefined. Could someone provide guidance on how to resolve this discrepancy in IE? Thank you.