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:

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}; } }
You'd invoke that sub (lots of handwaving here) thusly:
#!/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;
This way you can turn the spew off in production by flipping the value of $verbose_debug to zero.

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.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.