Ajax XMLHttpRequest with Perl GET

A

Angus

Hello

I want to get an Ajax example working with a Perl script.

I have this at the moment but nothing seems to get sent to the server

self.xmlHttpReq.open('GET', 'http://myurl.com/example.pl?name=lisa', true);
self.send();

But as I say nothing gets sent.

I then have a:
self.xmlHttpReq.onreadystatechange = function()

Which handles responses. Should this work? In a real script what would I
send for the open and what for the send?
 
G

Gregor Kofler

Angus meinte:
Hello

I want to get an Ajax example working with a Perl script.

I have this at the moment but nothing seems to get sent to the server

self.xmlHttpReq.open('GET', 'http://myurl.com/example.pl?name=lisa', true);
self.send();

But as I say nothing gets sent.

I then have a:
self.xmlHttpReq.onreadystatechange = function()

Which handles responses. Should this work? In a real script what would I
send for the open and what for the send?

Why not have a look at one of the zillions of examples, tutorials, etc.
about AJAX [1]? All you need to adapt is your URI when calling open().

Gregor

[1]
<http://www.google.at/search?q=ajax+tutorial>
or perhaps
<http://developer.mozilla.org/en/docs/XMLHttpRequest>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjxmlhttprequest.asp>
 
P

psema4

Angus meinte:
I want to get an Ajax example working with a Perl script.

Why not have a look at one of the zillions of examples, tutorials, etc.
about AJAX [1]? All you need to adapt is your URI when calling open().

Gregor

[1]
<http://www.google.at/search?q=ajax+tutorial>
or perhaps
<http://developer.mozilla.org/en/docs/XMLHttpRequest>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmls...>

In addition to the links that Gregor has posted, you may find the
CGI::Ajax Perl module (which comes with examples) useful. It hides
most of the javascript though; the Mozilla and Microsoft links are
better resources if you really want to understand the XMLHttpRequest
(XHR) object.

http://search.cpan.org/~bct/CGI-Ajax-0.697/lib/CGI/Ajax.pm
http://www.perl.com/pub/a/2006/03/02/ajax_and_perl.html

Another good reference:
http://en.wikipedia.org/wiki/XMLHttpRequest

- Scott.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,408
Latest member
AlenaRay88

Latest Threads

Top