I am not even going to attempt to troubleshoot your JQuery code. I can spell JQuery but that's about the extent of my knowledge on that subject.
However: let me throw you a few bones and at least provide you a methodology that I'd probably use if this were one of my consulting assignments. Are you using Firefox? If you are there is a wonderful tool for Firefox that can aid in the debugging of JavaScript based code and especially things like what you are attempting to do. The name of the tool is (offsite link) Firebug. This tool well let you watch the interaction between the JavaScript code and your web server. There is also a tool specifically for JQuery that is a Firefox pluging called (offsite)FireQuery. I have no experience with it but maybe you can try that.
Even more basic than that I'd suggest checking your sever logs and ensure that the POST is even happening.
My next step would be to put some debugging code into the backend script on the server. A sniglet you can put in:
You'd invoke that sub (lots of handwaving here) thusly:sub barf_my_guts_out { my $cgi=shift; open TRACE,sprintf("> /tmp/%s.debug.%d.txt",$0,$$) or die "Cannot open trace log: $!"; printf TRACE "CGI Variables Passed: \n"; printf TRACE "%20s\t%30s\n\n","Key","Value"; foreach my $key($cgi->param){ printf TRACE "%20s\t%30s\n",$key,$cgi->param($key); } printf TRACE "\n\nEnvironment Values:\n"; printf TRACE "%20s\t%30s\n\n","Key","Value"; foreach my $key (sort keys %ENV){ printf TRACE "%20s\t%30s\n",$key,$ENV{$key}; } }
This way you can turn the spew off in production by flipping the value of $verbose_debug to zero.#!/usr/bin/perl -w use strict; use CGI; # more stuff my $cgi = CGI->new(); # or however my $verbose_debug=1; barf_my_guts_out() if $verbose_debug;
Basic troubleshooting is based on an understanding of what the inputs are into a system and what the expected output should be. A system can always be broken down into smaller pieces that you can test the input to and output from in a methodical manner.
In reply to Re: Post from jQuery to Perl - can't access parameters
by blue_cowdawg
in thread Post from jQuery to Perl - can't access parameters
by stuckdev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |