The Perl part, assuming you've tagged this sub as a runmode:callbackFunction = function(options, success, response) { if (success === true) { var data = Ext.decode(response.responseText); doSomething(data); // or Ext.get('contents-div').dom.innerHTML = response.responseText; } else { Ext.MessageBox.alert('Error', 'Something blew up.'); } } Ext.Ajax.request({ url: '/path/to/cgi', callback: callbackFunction, params: { rm: 'ajax_function' } });
It has other cool stuff built in, like the ability to automatically generate fields and labels for a form, and bind the validation and submission to callback functions, visual effects, data stores and interfaces for all different kinds of sources... it actually got me interested in learning JS. Pretty cool stuff.sub ajax_function { my ($self) = @_; my $data = doStuff(); # or you could return HTML return $self->{json}->objToJson($data); }
In reply to Re: AJAX'ifying a web form and dynamic server validation through Perl
by mattk
in thread AJAX'ifying a web form and dynamic server validation through Perl
by hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |