I need to load a dynamic created javascript with PHP. Is there any good solution to load javascript creating by PHP after some ajax requests finished?
Thx in regards, i am searching for 2h in stackoverflow.
if i call .ajax function where html/js respone, jquery kills the js ;/
<script>your JS here</script>and append it to your document, you can create actual JS and useeval()like @shadow said or you can just rethink your approach and create a system that receives data from PHP and acts upon it.<script>...</script>blocks do not generally execute when you add them to the document. I believe some libraries (Underscore?) do a bit of work to simulate this, by scanning for<script>tags andeval(...)ing them, but it doesn't happen automatically in any modern browser.