Obviously I am missing something here.
I am trying to create a widget type of app, so all i want the site owner to have to do is drop 1 line of code (for now no params) into their HTML. So for example below.
I have an HTML page with this in the body:
<script type="text/javascript" src="
http://mydomain.com/dev/calendar/cal.php"></script>
in the cal.php I have
<?php
$buf = <<<BUF
document.write("<script type=\"text/javascript\" src=\"http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js\"></script>");
$(document).ready(function(){
alert('aaa');
});
BUF;
echo $buf;
?>
if I monitor the headers, I can see the browser pull down the jquery library, no problem. but the .ready event never fires, and i think its because it has already happened. THe page is already done, THEN the jquery library is pulled down?
so without a .ready event available wtf do i do here to get my code to run. in this case just a simple alert box.