Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: retrieving value from ajax call to cgi page

by derby (Abbot)
on Jun 29, 2013 at 12:37 UTC ( #1041460=note: print w/ replies, xml ) Need Help??


in reply to Re^2: retrieving value from ajax call to cgi page
in thread retrieving value from ajax call to cgi page

Help me understand 'will not print in the browser.' Your JQuery snippet above just alerts the data, are you seeing the value in the alert box or not?

If not, when you click on the network tab in firebug, look for your URL and ensure the response code was 200 (or whatever success code you're sending). If the ajax call http response was not successful, check your server error logs for any server side issues.

If the ajax call was successful, click on the URL in firebug and click on the response tab. Is the data coming back the way you expect? If not, then check your server side logic to ensure you're doing what needs to be done (you can post your perl snippets then).

If the data is coming back correctly, then double check the console tab in firebug -- you may have some other javascript error that's causing problems.

-derby

update: forgot to add, there's nothing special about AJAX for the perl/server side perspective. Wether the call is AJAX or the result of a click on an anchor element, perl/server side could care less. Many times when I'm debugging JQuery, I do the testing outside of the page on which the AJAX call resides. Wether that's a simple http://foo.com/cgi-bin/process.cgi?value=bar call on the browser or something more complicated via POSTing, it doesn't matter.


Comment on Re^3: retrieving value from ajax call to cgi page

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041460]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-08-20 13:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (113 votes), past polls