Home

# Class goog.net.CrossDomainRpc

Creates a new instance of cross domain RPC

extends goog.events.EventTarget

Instance Method Summary
| `detectResponse_(number responseDetectorHandle)` Detects response inside request frame
| `getResponseHeader(string name) ⇒ (string|undefined)` Gets a response header.
| `getResponseJson() ⇒ (Object|null|undefined)` If response is JSON, evaluates it to a JavaScript object and returns it; otherwise returns undefined.
| `isSuccess() ⇒ boolean`
| `receiveResponse_()` Receives response by polling to check readiness of response and then reads response frames and assembles response data
| `reset()` Removes request iframe used.
| `sendRequest(string uri, string= opt_method, ?Object= opt_params, ?Object= opt_headers)` Sends a request across domain.

Static Method Summary
| `createInputHtml_(string name, <Any Type> value) ⇒ string` Creates the HTML of an input element
| `createResponseInfo_(string dummyUri, number numChunks, boolean isDataJson, number status, string headers)` Creates a response info iframe to indicate completion of sendResponse
| `escapeAmpersand_(<Any Type> value) ⇒ <Any Type>` Escapes ampersand so that XML/HTML entities are submitted as is because browser unescapes them when they are put into a text area.
| `getDummyResourceUri_() ⇒ string` Finds a dummy resource that can be used by response to gain domain of requester's page.
| `getFramePayload_(?Object 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.
| `getPayloadDelimiter_(string 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.
| `isInResponseIframe_() ⇒ <Any Type>` 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.
| `isResponseInfoFrame_(?Object frame) ⇒ boolean` Checks whether a frame is response info frame.
| `removeHash_(string uri) ⇒ string` Removes everything at and after hash from URI
| `removeUriParams_(string uri) ⇒ string` Removes all parameters (after ? or #) from URI.
| `send(string uri, ?Function= opt_continuation, string= opt_method, ?Object= opt_params, ?Object= opt_headers)` Sends a request across domain.

`sendResponse(string data, boolean isDataJson, ?Object echo, number status, string headers)`

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.

| `setDebugMode(boolean 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.
| `setDummyResourceUri(string 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.
| `setUseFallBackDummyResource(boolean 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.