I am using JQuery to call a PHP file and then I am using
document.getElementById(output).innerHTML=data;
in the success function to output the text coming from the PHP file. This is all okay and the output is all fine. Part of the response from the PHP file is also some inline javascript (I am using a simple alert as an example). So the PHP writes:
echo "<script>";
echo "alert('Hello World!');";
echo "</script>";
This Javascript is not executed somehow. It is written to the DOM but not executed. Is it because there's no event that triggers the Javascript?
This is the HTML output:
<script>alert('Hello World!');</script>