/    Sign up×
Community /Pin to ProfileBookmark

simple hangup (I suspect)

Hey gang –

I’ve got an ajax function that works fine and returns the xml exactly as it should, but in an effort to package it up and make it a little more useable, I can’t handle the output. Upon success, the ajax function uses:

return xmlhttp.responseXML;

So, inside of a different function I want to get the output of this server call and store it. Pretty simple, eh? Here’s what I do:

var response = ajax_function(foo);

response comes back undefined! This seems very elementary but I ain’t catching it, any takers?

Also I should mention that using firebug I see the xml output just as I would expect it, so it’s only a problem of passing the output.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@scott212authorMar 18.2007 — I have a feeling this has to do with the fact that the ajax call has been made, but the rest of the calling function doesn't wait for the response.
Copy linkTweet thisAlerts:
@ZnupiMar 18.2007 — I have a suspicion that what you are doing is [b]very[/b] wrong. Please post the whole code.
×

Success!

Help @scott212 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.9,
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,
)...