/    Sign up×
Community /Pin to ProfileBookmark

Need help processing data in the background

I am programming a site for a client and they have a lot of math that goes on on one particular page. Some of the math actually applies to data that is not displayed on the page, but I need that data to be processed and updated in the background. Seeing as I am using javascript/ajax already, I fuigured that there must be some way for me to incorporate an event handler that calls an ajax function to process the data in the background. How would I go about this? I am quite new to the whole AJAX thing, and am pretty much learning as I incorporate and disect code, so any help would be appreciated even if its just a pointer to some other thread that might help me out.

Thanks!

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@Angry_Black_ManNov 06.2007 — you mention that youre already using some ajax. i assume you know how to create an ajax request already. forget how the request is initiated (the event handler), and focus instead on the work that will be done after the request is initiated. do you have a grasp on how to do that?

the "event handling" is another issue entirely. wether youre doing an AJAX request or simply popping up an alert box, there will be a billion ways to skin the event handling cat.

do you already know how to send the ajax request?
Copy linkTweet thisAlerts:
@takuyaauthorNov 06.2007 — The AJAX that I have used so far has been packaged scripts that perform a particular function, i.e. drag and drop, that I didnt have to write. All I have done is messed around with them to a point where I can understand what to modify to make it do what I want to do.

This will actually be my first script that will be written from the ground up as I havent found anything else out there that even comes close to what I want to do. I haven't made it that far in the AJAX bible either....so, I guess, no, I dont know how to send the request, or maybe I just dont understand what that means. Can you point me in the right direction to learn about the AJAX request?
Copy linkTweet thisAlerts:
@Angry_Black_ManNov 06.2007 — i only got into ajax within the last 5 or so months. it is extremly simple to implement. there are a great deal of advanced techniques i havent really learned yet (cross domain requests, and actually using POST for any reason), but i can promise you that it is terribly easy to grasp.

http://w3schools.com/ajax/default.asp

that link is your first step. it very succinctly outlines the process from a very basic standpoint. you create the ajax object by determining what the browser supports. once you create the object, you set up the request, send the request, and then wait for the proper response. once that response is received, you can then manipulate the data (if necessary) as update your webpage with said data. in your case, i really think you'd only want to know that the page you sent the request to had finished processing.
Copy linkTweet thisAlerts:
@takuyaauthorNov 06.2007 — i only got into ajax within the last 5 or so months. it is extremly simple to implement. there are a great deal of advanced techniques i havent really learned yet (cross domain requests, and actually using POST for any reason), but i can promise you that it is terribly easy to grasp.

http://w3schools.com/ajax/default.asp

that link is your first step. it very succinctly outlines the process from a very basic standpoint. you create the ajax object by determining what the browser supports. once you create the object, you set up the request, send the request, and then wait for the proper response. once that response is received, you can then manipulate the data (if necessary) as update your webpage with said data. in your case, i really think you'd only want to know that the page you sent the request to had finished processing.[/QUOTE]



I use POST for the drag drop stuff that I am doing...but again, like I said it was all packaged and I basically modified here and there to get it to display the way i wanted and process the info I needed it to process on the back end. That whole thing does what I need to do now, but in a much grander scale.

I will take a look at the URL and see what I can get from there. Thank you!
Copy linkTweet thisAlerts:
@Angry_Black_ManNov 07.2007 — off topic:

ive never understood why people completely quote a post that is directly above them??? it is the epitome of being redundant, and serves only to unecessarily bloat the response...??

?
Copy linkTweet thisAlerts:
@takuyaauthorNov 07.2007 — hahaha- point taken.
×

Success!

Help @takuya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...