[jQuery] Using $.get with preload page seems to strip JavaScript

[jQuery] Using $.get with preload page seems to strip JavaScript


Hi guys,
I want to display a simple "Loading..." image while my page loads.
I've got it halfway working at http://pranshuarya.com/test.html. The
problem is that once the page gets loaded, the JavaScript
functionality in it doesn't work (even though the files are getting
loaded). You'll know what I mean if you compare what gets loaded to
the main page (http://pranshuarya.com).
The approach I'm taking is to call the following function via <body
onload"loadSite()">
function loadSite(){
    jQuery.get("test.php", function(data) {
        jQuery(document).ready(function() {
            jQuery('#loader').hide();
            jQuery('body').prepend(data);
        });
});
}
So test.html loads up, displays the preloader image, fetches test.php
via $.get, and once the DOM is ready, hides the preloader and prepends
the contents of test.php to <body> of test.html. All the JavaScript
functions are in test.html, not test.php. Test.php contains only PHP
and HTML code.
I'm not even sure if this is the right approach to do what I want.
I'm just experimenting since I haven't been able to find any solid
documentation on it. Is $.get the right function or should I use
something else?
Any help would be greatly appreciated.
Thanks,
pthesis.