Omirion Posted January 22, 2011 Share Posted January 22, 2011 Hy guys, When i am making an ajax request to JS file what jQuery method should i use to get the return value of that script rather that the entire script itself. A little clarification. The returned information from the JS script will be in JSON. I also need a way to send some data to the JS file. (string or another JSON object) Then the js script will make some things internally and return data accordingly. I also need to be able to set a callback function so i can make use of the returned data. Is there a way to do this , or am i not understanding the way JS files work in general... Will this be done more easily in PHP? Quote Link to comment Share on other sites More sharing options...
trq Posted January 22, 2011 Share Posted January 22, 2011 Ajax is used to make another request back to the server? Why would you need to request a js file? Just include the file as normal. Quote Link to comment Share on other sites More sharing options...
Omirion Posted January 22, 2011 Author Share Posted January 22, 2011 No the JS file file will not make another request to the server. I'm using the JS file to store some information. And can potentially get a bit large. So i thought that i could make it into a script that returns only the information that is requested. I decided to go with JS cause JSON is a bitch to work with in PHP... as i remember... Maybe i can lazy load it? Quote Link to comment Share on other sites More sharing options...
Omirion Posted January 22, 2011 Author Share Posted January 22, 2011 Nevermind, decided to make my life easier and just go wit the flow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.