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!