Hi!
I have a JS ajax function that goes into PHP file and returns (by echo) javascript code (a string data). All that is echo-d is in "return_data" variable. The problem is that returned JS code wont run.
For example if i try to return simple JS function alert from PHP file i get nothing, if it is wrapped in <script> - tags. If its not wrapped in script tags, its just printed out.
I tried eval() function. Same effect.
It is line from JS ajax function that prints data to ID-ed div:
document.getElementById("ID").innerHTML = return_data;
The thing im trying to do is to have a have a function that runs for example onClick and fills in with data some PHP pre-written ID-ed div-s. I want to achieve dynamic effects without using refresh.
Thank you in advance!