On a website i have 2 ajax function, the 1st one is working but the second is sending me script tag with the JSON. On local everything is working well and one of my AJAX function is working so i presume that my problem dont come from my host. Here is screenshot of my code & the return.
CodePudding user response:
The site you are making an ajax request to is returning the data the script. If that site is yours then you should make it return the data only and never include scripts in APIs.
As you can clearly see in the received data that it returns the script the data.
CodePudding user response:
So i fixed it, im using symfony, the problem came from my controller. In my return i was sending an object which isnt "jsonify" so it gaves me script tag to do it. But i still dont know why it worked on local