This seems to be a Safari only issue. I tried 4 on Mac and 3 on Windows, and I'm still out of luck.
I am trying to load an external HTML file and execute inline JavaScript.
The code I'm trying to use is as follows:
$("#myBtn").click(function() { $("#myDiv").load("trackingCode.html"); });
trackingCode.html looks like this (just now, but will expand once / if I get this working):
<html> <head> <title>Tracking HTML File</title> <script language="javascript" type="text/javascript"> alert("outside the jQuery ready"); $(function() { alert("inside the jQuery ready"); }); </script> </head> <body> </body> </html>
I see both warnings in IE (6 and 7) and Firefox (2 and 3). However, I cannot see the messages in Safari (the last browser I need is the project requirements - please, no fiery wars).
Any thoughts on why Safari ignores JavaScript in the trackingCode.html file?
In the end, I would like to be able to pass JavaScript objects to this trackingCode.html file, which will be used in the jQuery ready call, but I would like to make sure that this is possible in all browsers before I go down this road.
jquery safari ajax
Mike May 20 '09 at 20:07 2009-05-20 20:07
source share