Jump to content

jQuery ajax request to a JS file


Omirion

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.