crossdomainrpc.js
No description.

File Location

/goog/net/crossdomainrpc.js

Classes

goog.net.CrossDomainRpc
Creates a new instance of cross domain RPC

Public Protected Private

Global Functions

goog.net.CrossDomainRpc.sendResponse&checkToCreateResponseInfo_()
No description.
code »
goog.net.CrossDomainRpc.createInputHtml_(namevalue) string
Creates the HTML of an input element
Arguments:
name : string
Name of input element.
value : *
Value of input element.
Returns: string  HTML of input element with that name and value.
code »
goog.net.CrossDomainRpc.createResponseInfo_(dummyUrinumChunksisDataJsonstatusheaders)
Creates a response info iframe to indicate completion of sendResponse
Arguments:
dummyUri : string
URI to a dummy resource.
numChunks : number
Total number of chunks.
isDataJson : boolean
Whether response is a JSON string or just string.
status : number
HTTP response status code.
headers : string
Response headers in JSON format.
code »
goog.net.CrossDomainRpc.escapeAmpersand_(value) *
Escapes ampersand so that XML/HTML entities are submitted as is because browser unescapes them when they are put into a text area.
Arguments:
value : *
Value to escape.
Returns: *  Value with ampersand escaped, if value is a string; otherwise the value itself is returned.
code »
goog.net.CrossDomainRpc.getDummyResourceUri_() string
Finds a dummy resource that can be used by response to gain domain of requester's page.
Returns: string  URI of the resource to use.
code »
goog.net.CrossDomainRpc.getFramePayload_(frame) string
Returns the payload of a frame (value after # or ? on the URL). This value is URL encoded except IE, where the value is not encoded to begin with.
Arguments:
frame : Object
Frame.
Returns: string  Payload of that frame.
code »
goog.net.CrossDomainRpc.getPayloadDelimiter_(dummyUri) string
Returns payload delimiter, either "#" when caller's page is not used as the dummy resource or "?" when it is, in which case caching issues prevent response frames to gain the caller's domain.
Arguments:
dummyUri : string
URI to resource being used as dummy resource.
Returns: string  Either "?" when caller's page is used as dummy resource or "#" if it is not.
code »
goog.net.CrossDomainRpc.isInResponseIframe_() *
Checks to see if we are executing inside a response iframe. This is the case when this page is used as a dummy resource to gain caller's domain.
Returns: *  True if we are executing inside a response iframe; false otherwise.
code »
goog.net.CrossDomainRpc.isResponseInfoFrame_(frame) boolean
Checks whether a frame is response info frame.
Arguments:
frame : Object
Frame to check.
Returns: boolean  True if frame is a response info frame; false otherwise.
code »
goog.net.CrossDomainRpc.removeHash_(uri) string
Removes everything at and after hash from URI
Arguments:
uri : string
Uri to to remove hash.
Returns: string  Uri with its hash and all characters after removed.
code »
goog.net.CrossDomainRpc.removeUriParams_(uri) string
Removes all parameters (after ? or #) from URI.
Arguments:
uri : string
URI to remove parameters from.
Returns: string  URI with all parameters removed.
code »
goog.net.CrossDomainRpc.send(uriopt_continuationopt_methodopt_paramsopt_headers)
Sends a request across domain.
Arguments:
uri : string
Uri to make request to.
opt_continuation : Function=
Continuation function to be called when request is completed. Takes one argument of an event object whose target has the following properties: "status" is the HTTP response status code, "responseText" is the response text, and "headers" is an object with all response headers. The event target's getResponseJson() method returns a JavaScript object evaluated from the JSON response or undefined if response is not JSON.
opt_method : string=
Method of request. Default is POST.
opt_params : Object=
Parameters. Each property is turned into a request parameter.
opt_headers : Object=
Map of headers of the request.
code »
goog.net.CrossDomainRpc.sendResponse(dataisDataJsonechostatusheaders)
Makes response available for grandparent (requester)'s receiveResponse call to pick up by creating a series of iframes pointed to the dummy URI with a payload (value after either ? or #) carrying a chunk of response data and a response info iframe that tells the grandparent (requester) the readiness of response.
Arguments:
data : string
Response data (string or JSON string).
isDataJson : boolean
true if data is a JSON string; false if just a string.
echo : Object
Parameters to echo back "xdpe:request-id": Server that produces the response needs to copy it here to support multiple current XD requests on the same page. "xdpe:dummy-uri": URI to a dummy resource that response iframes point to to gain the domain of the client. This can be an image (IE) or a CSS file (FF) found on the requester's page. Server should copy value from request parameter "xdpe:dummy-uri".
status : number
HTTP response status code.
headers : string
Response headers in JSON format.
code »
goog.net.CrossDomainRpc.setDebugMode(flag)
Sets debug mode to true or false. When debug mode is on, response iframes are visible and left behind after their use is finished.
Arguments:
flag : boolean
Flag to indicate intention to turn debug model on (true) or off (false).
code »
goog.net.CrossDomainRpc.setDummyResourceUri(dummyResourceUri)
Sets the URI for a dummy resource on caller's domain. This function is used for specifying a particular resource to use rather than relying on auto detection.
Arguments:
dummyResourceUri : string
URI to dummy resource on the same domain of caller's page.
code »
goog.net.CrossDomainRpc.setUseFallBackDummyResource(useFallBack)
Sets whether a fallback dummy resource ("/robots.txt" on Firefox and Safari and current page on IE) should be used when a suitable dummy resource is not available.
Arguments:
useFallBack : boolean
Whether to use fallback or not.
code »

Directory net

File Reference