GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WWW::Scripter::Plugin::Ajax(3) User Contributed Perl Documentation WWW::Scripter::Plugin::Ajax(3)

WWW::Scripter::Plugin::Ajax - WWW::Scripter plugin that provides the XMLHttpRequest object

Version 0.09 (alpha)

  use WWW::Scripter;
  $w = new WWW::Scripter;
  
  $m->use_plugin('Ajax');
  $m->get('http://some.site.com/that/relies/on/ajax');

This module is a plugin for WWW::Scripter that loads the JavaScript plugin (WWW::Scripter::Plugin::JavaScript) and provides it with the "XMLHttpRequest" object.

To load the plugin, use WWW::Scripter's "use_plugin" method, as shown in the Synopsis. Any extra arguments to "use_plugin" will be passed on to the JavaScript plugin (at least for now).

The "XMLHttpRequest" object currently does not support asynchronous connections. Later this will probably become an option, at least for threaded perls.

Since it uses LWP, URI schemes other than http (e.g., file, ftp) are supported.

The XMLHttpRequest interface members supported so far are:

  Methods:
  open
  send
  abort
  getAllResponseHeaders
  getResponseHeader
  setRequestHeader
  
  Attributes:
  onreadystatechange
  readyState
  responseText
  responseXML
  status
  statusText
  
  Event-Related Methods:
  addEventListener
  removeEventListener
  dispatchEvent

  Constants (static properties):
  UNSENT
  OPENED
  HEADERS_RECEIVED
  LOADING
  DONE

"responseBody", "overrideMimeType", "getRequestHeader", "removeRequestHeader" and more event attributes are likely to be added in future versions.

This plugin requires perl 5.8.5 or higher, and the following modules:
  • WWW::Scripter::Plugin::JavaScript version 0.002 or later
  • constant::lexical
  • XML::DOM::Lite
  • HTML::DOM version 0.013 or later
  • Encode 2.09 or higher
  • WWW::Scripter
  • LWP 5.833 or higher
  • URI

If you find any bugs, please report them to the author by e-mail (preferably with a patch :-).

XML::DOM::Lite is quite lenient toward badly-formed XML, so the "responseXML" property returns something useful even in cases when it should be null.

The SECURITY_ERR, NETWORK_ERR and ABORT_ERR constants are not available yet, as I don't know where to put them.

It does not conform to the spec in every detail, since the spec is still being written and is different every time I check it.

None of the additional features in the Level 2 spec are implemented.

There is currently no API to signal that the user has cancelled a connection. You can call the "abort" method, but that does not have exactly the same result that a user-initiated cancellation is meant to have.

Furthermore, this module follows the badly-designed API that is unfortunately the standard so I can't do anything about it.

Copyright (C) 2008-11 Father Chrysostomos <"['sprout', ['org', 'cpan'].reverse().join('.')].join('@')">

This program is free software; you may redistribute it and/or modify it under the same terms as perl.

Erwan Mas provided a bug fix.

WWW::Scripter

WWW::Scripter::Plugin::JavaScript

XML::DOM::Lite

The "XMLHttpRequest" specification (draft as of August 2009): <http://www.w3.org/TR/XMLHttpRequest/>

"XMLHttpRequest" Level 2: <http://www.w3.org/TR/XMLHttpRequest2/>

WWW::Mechanize::Plugin::Ajax (the original version of this module)

2011-03-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.