I have a problem that's occurring in IE (7) and no other browser (surprise surprise).
On my site I've defined a function loadAJAX, that displays an animated loading image, commences a .load() function, .eval's the scripts inside the AJAX chunk, and then hides the animated loading image:
- function loadAJAX(phpFile, divElement)
- {
- $("#loadingImage").show();
- $("#animatedLoadingDiv").show();
-
- var url = "includes/" + phpFile;
- $("#" + divElement).load(url, function()
- {
- $("#" + divElement + " script").each(function(ind,obj)
- {
- eval($(obj).text());
- });
- $("#loadingImage").hide();
- $("#animatedLoadingDiv").hide();
- return false;
- });
- }
This function works fine in all browsers... except IE
IE will
not eval() this:
- <script type="text/javascript">
- // my code here
- </script>
...but it will eval() this...
- <script>
- // my code here
- </script>
Is there any way to get IE to recognise scripts with the "text/javascript" attribute?