Class PTHTTPGETRequest
Object
|
+--PTHTTPRequest
|
+--PTHTTPGETRequest
- class
PTHTTPGETRequest
- extends PTHTTPRequest
Object wrapper for "in-place" client-server GET operations. Invoking a PTHTTPGETRequest
will cause a background HTTP request to be sent to the server without reloading the contents
of the browser. PTHTTPGETRequests can be set to automatically refresh the inner HTML of an
element on the page, or to have the HTTP response that they generate be handled by a
JavaScript function.
Usage:
// refresh the content of an element
var request = new PTHTTPGETRequest('foo.jsp', document.getElementById('refresh-elem-id'));
request.setRequestHeader('my-custom-header', 'headervalue');
request.invoke();
OR
// invoke a response handling function
function handleResponse(resp) { alert(resp.responseText); }
var request = new PTHTTPGETRequest('foo.jsp', handleResponse);
request.invoke();
Defined in PTHTTPGETRequest.js
Fields inherited from class PTHTTPRequest |
url, type, callback, targetElement, responsePreProcHandler, responsePostProcHandler, concurrencyMode, requestHeaders, properties, _requestForm, formDataSet
|
Constructor Summary |
PTHTTPGETRequest
(url, responseHandler, concurrencyMode, properties)
Creates a new "in-place" client-server get request
|
className
<private> Object className
properties
Object properties
VERSION
<static> <final> Object VERSION
PTHTTPGETRequest
PTHTTPGETRequest(url, responseHandler, concurrencyMode, properties)
Creates a new "in-place" client-server get request
Parameters:
url
- Server-side request URL (string)
responseHandler
- This can be either a callback function to call and pass back results of the request (string or Function) or it can be a target HTML element, whose innerHTML property will be set from the response text.
concurrencyMode
- How to handle concurrent requests, optional (PTHTTPTransport.CCMODE constant)
properties
- Associative array of key/value pairs available for arbitrary use, optional (Object)
Documentation generated by
JSDoc on Tue Sep 21 02:04:06 2010