I'm calling a php script that includes some js code by calling XMLHttpRequest.send. Unfortunatly the javascript code in the called php script is not being executed.
The calling routine:
var formdata = new FormData();
formdata.append("uploadfilename", file);
var ajax = new XMLHttpRequest();
ajax.upload.addEventListener("progress", progressHandler, false);
ajax.addEventListener("load", completeHandler, false);
ajax.addEventListener("error", errorHandler, false);
ajax.addEventListener("abort", abortHandler, false);
ajax.open("POST", "mod/intern/uploader_upload_done.php");
ajax.send(formdata);
Any javascript in the called script fails, even an alert() call.
File uploader_upload_done.php:
<?php echo date(); ?>
<script>alert("hallo");</script>
When calling uploader_upload_done.php directly, everything works as it should.
What am I doing wrong?