Ajax requests without ajax calls

Ajax requests without ajax calls

Hi,

the site I'm talking about is here:
http://vinylkoffer.de/upload/index.php

I have this idea of the browser warning you to not close the window while the upload is processing.
I do have a working script, but I'd like to do all of that using jQuery instead of plain javascript.

It works fine, but now, when I submit the form and start the upload, both embedded javascript files are being requested using ajax. Nowhere in my code it says that I want any js files to load.

Maybe I messed up the script injection (I use timeout for a reason), but I'm not too sure since this is my first time using jQuery.

Any help would be appreciated.
Thank you!

// edit:

If I use this code:
$("<script>"+(window.onbeforeunload = function(e) {
                  e = e || window.event;
                  e.returnValue = "The upload is still processing.";
               }).toString()+"</script>").appendTo("body");
, I get a weird "Syntax error" in Firebug.
I'm positive that that window.onbeforeunload function code is correct.