I am in problem to get the array data from php to use it in js.
I want to use those data in js.
Can anyone help me ??
thank you for your helping,but I need to first check the data ,If data exists then run the js code otherwise not.
first : read data from database .
second : check the data
third : if data exists then run js otherwise not.
i do it in the same file.but I want to simplify my code ,so I need to place the js code in the other file.
i just need if their have any possibility to get the array data of php in js.
You can get the JS script into some other file, but make this script use some global variable.
By this way you can parse needed array in PHP, then put the value on page and if the JS script included will find those, it will run.
It's hard code, but will work.