LnkWcb Framework

LnkWcb  2.5.0

LnkWcb Framework > LnkWcb > LnkWcb.Request
Search:
 
Filters

private Class LnkWcb.Request

Request abstraction class.

Uses <script/> element injection in the head of the document.

Constructor

LnkWcb.Request ( )

Methods

composeQueryString

private String composeQueryString ( params )
Create a %-encoded query string from an object of strings. This is quite an opposite of LnkWcb.util.urlDecode(). The difference is that multiple values are not supported.
Parameters:
params <Object<String>> the query string parameters
Returns: String
the encoded query string

finish

protected void finish ( )
Terminate a request.

This method is automatically called at the end of the server response execution. You need not call it directly.


injectScriptElem

private void injectScriptElem ( attrs , that )
Injects a <script/> element in the head of the document.
  • attrs.id specifies the element ID attribute
  • attrs.baseUrl specifies the beginning of the element SRC attribute
  • attrs.params specifies the SRC query string parameters
The attrs.params.scriptId gets filled with the ID of the injected element. So that it is forced for all generated queries.
Parameters:
attrs <Object> attributes of the script element
that <Object> an optional object that might provide the Document instance to use (useful for isolation in unit tests)

removeElem

private void removeElem ( elemId , that )
Removes a <script/> element from the head of the document.
Parameters:
elemId <String> the script element ID
that <Object> an optional object that might provide the Document instance to use (useful for isolation in unit tests)

send

void send ( baseUrl , params , chainFnName )
Sends a (cross-domain) request.

JSONP callback is implemented as it is by default in jQuery.ajax. This means that the parameter name is callback and not jsonp as in wikipedia or Bob Ippolito's spec.

Parameters:
baseUrl <String> the server base URL
params <Object|null> the (optional) query parameters
chainFnName <String> an optional JSONP callback name


Copyright © 2010 Linkeo.com All rights reserved.