goog.Disposable | |
goog.events.EventTarget | goog.Disposable |
goog.net.IframeIo | goog.events.EventTarget |
![]()
Abort the current Iframe request
Arguments:
|
code » | ||||
![]()
Appends the Iframe to the document body.
|
code » | ||||
![]()
Removes all the child nodes from the static form so it can be reused again.
This should happen right after sending a request. Otherwise, there can be
issues when another iframe uses this form right after the first iframe.
|
code » | ||||
![]()
Creates an iframe to be used with a request. We use a new iframe for each
request so that requests don't create history entries.
|
code » | ||||
![]()
Disposes of the Form. Since IE6 leaks form nodes, this just cleans up the
DOM and nullifies the instances reference so the form can be used for another
request.
|
code » | ||||
![]()
Disposes any iframes.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
Returns: HTMLDocument
The appropriate content document.
|
code » | ||||
Gets the callback function used to check if a loaded IFrame is in an error
state.
Returns: Function
A callback that expects a document object as it's single
argument.
|
code » | ||||
Gets the last custom error.
Returns: Object
Last custom error.
|
code » | ||||
Gets the last error message.
Returns: string
Last error message.
|
code » | ||||
![]()
Gets the last error code.
Returns: goog.net.ErrorCode
Last error code.
|
code » | ||||
Get the uri of the last request.
Returns: goog.Uri
Uri of last request.
|
code » | ||||
![]()
No description.
Returns: HTMLIFrameElement
The appropriate iframe to use for requests
(created in sendForm_).
|
code » | ||||
Returns the last response html (i.e. the innerHtml of the iframe).
Returns: ?string
Result from the server.
|
code » | ||||
Parses the content as JSON. This is a safe parse and may throw an error
if the response is malformed.
Use goog.json.unsafeparse(this.getResponseText()) if you are sure of the
state of the returned content.
Returns: Object
The parsed content.
|
code » | ||||
Returns the last response text (i.e. the text content of the iframe).
Assumes plain text!
Returns: ?string
Result from the server.
|
code » | ||||
![]()
Returns the document object from the last request. Not truely XML, but
used to mirror the XhrIo interface.
Returns: HTMLDocument
The document object from the last request.
|
code » | ||||
Returns the number of milliseconds after which an incomplete request will be
aborted, or 0 if no timeout is set.
Returns: number
Timeout interval in milliseconds.
|
code » | ||||
![]()
Handles errors.
Arguments:
|
code » | ||||
![]()
Dispatches an event indicating that the IframeIo instance has received a data
packet via incremental loading. The event object has a 'data' member.
Arguments:
|
code » | ||||
![]()
Handles generic post-load
Arguments:
|
code » | ||||
No description.
Returns: boolean
True if a transfer is in progress.
|
code » | ||||
No description.
Returns: boolean
True if transfer is complete.
|
code » | ||||
No description.
Returns: boolean
Whether the server response is being ignored.
|
code » | ||||
No description.
Returns: boolean
True if transfer was successful.
|
code » | ||||
![]()
Finalizes the request, schedules the iframe for disposal, and maybe disposes
the form.
|
code » | ||||
![]()
Handles the load event of the iframe for IE, determines if the request was
successful or not, handles clean up and dispatching of appropriate events.
Arguments:
|
code » | ||||
![]()
Handles the load event of the iframe for non-IE browsers.
Arguments:
|
code » | ||||
![]()
Schedules an iframe for disposal, async. We can't remove the iframes in the
same execution context as the response, otherwise some versions of Firefox
will not detect that the response has correctly finished and the loading bar
will stay active forever.
|
code » | ||||
![]()
Sends a request via an iframe.
A HTML form is used and submitted to the iframe, this simplifies the
difference between GET and POST requests. The iframe needs to be created and
destroyed for each request otherwise the request will contribute to the
history stack.
sendFromForm does some clever trickery (thanks jlim) in non-IE browsers to
stop a history entry being added for POST requests.
|
code » | ||||
![]()
Submits the internal form to the iframe.
|
code » | ||||
![]()
Sends the data stored in an existing form to the server. The HTTP method
should be specified on the form, the action can also be specified but can
be overridden by the optional URI param.
This can be used in conjunction will a file-upload input to upload a file in
the background without affecting history.
Example form:
<form action="/server/" enctype="multipart/form-data" method="POST"> <input name="userfile" type="file"> </form>
Arguments:
|
code » | ||||
![]()
Sets the callback function used to check if a loaded IFrame is in an error
state.
Arguments:
|
code » | ||||
![]()
Sets whether to ignore the response from the server by not adding any event
handlers to fire when the iframe loads. This is necessary when using IframeIo
to submit to a server on another domain, to avoid same-origin violations when
trying to access the response. If this is set to true, the IframeIo instance
will be a single-use instance that is only usable for one request. It will
only clean up its resources (iframes and forms) when it is disposed.
Arguments:
|
code » | ||||
![]()
Sets the number of milliseconds after which an incomplete request will be
aborted and a
goog.net.EventType.TIMEOUT event raised; 0 means no
timeout is set.
Arguments:
|
code » | ||||
![]()
Tests for a silent failure by firefox that can occur when the connection is
reset by the server or is made to an illegal URL.
|
code » |
![]()
Use
#listen instead, when possible. Otherwise, use
goog.events.listen if you are passing Object
(instead of Function) as handler.
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Arguments:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Removes listeners from this object. Classes that extend EventTarget may
need to override this method in order to remove references to DOM Elements
and additional listeners.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget
The parent EventTarget or null if
there is no parent.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Use
#unlisten instead, when possible. Otherwise, use
goog.events.unlisten if you are passing Object
(instead of Function) as handler.
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
Whether the object is currently active with a request.
|
Code » | |
![]()
Whether the last request is complete.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
This is used to ensure that we don't handle errors twice for the same error.
We can reach the
#handleError_ method twice in IE if the form is
submitted while IE is offline and the URL is not available.
|
Code » | |
![]()
Window timeout ID used to detect when firefox silently fails.
|
Code » | |
![]()
Reference to form element that gets reused for requests to the iframe.
|
Code » | |
![]()
Window timeout ID used by the timer that disposes the iframes.
|
Code » | |
![]()
Name of the iframe being used for the current request, or null if no
request is currently active.
|
Code » | |
![]()
Reference to the iframe being used for the current request, or null if no
request is currently active.
|
Code » | |
![]()
An array of iframes that have been finished with. We need them to be
disposed async, so we don't confuse the browser (see below).
|
Code » | |
![]()
Whether to suppress the listeners that determine when the iframe loads.
|
Code » | |
![]()
The text content of the last request.
|
Code » | |
![]()
Last error code
|
Code » | |
The URI for the last request.
|
Code » | |
Reference to a logger for the IframeIo objects
|
Code » | |
![]()
Name for this IframeIo and frame
|
Code » | |
![]()
Next id so that iframe names are unique.
|
Code » | |
![]()
Whether the last request was a success.
|
Code » | |
![]()
Window timeout ID used to cancel the timeout event handler if the request
completes successfully.
|
Code » | |
![]()
Number of milliseconds after which an incomplete request will be aborted and
a
goog.net.EventType.TIMEOUT event raised; 0 means no timeout is set.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
Parent event target, used during event bubbling.
TODO(user): Change this to goog.events.Listenable. This
currently breaks people who expect getParentEventTarget to return
goog.events.EventTarget.
|
Code » |
![]()
Adds the key value pairs from a map like data structure to a form
Arguments:
|
code » | ||||||
![]()
Gets a static form, one for all instances of IframeIo since IE6 leaks form
nodes that are created/removed from the document.
Returns: !HTMLFormElement
The static form.
|
code » | ||||||
![]()
Find an iframe by name (assumes the context is goog.global since that is
where IframeIo's iframes are kept).
Arguments:
Returns: HTMLIFrameElement
The iframe element with that name.
|
code » | ||||||
Find an instance of the IframeIo object by name.
Arguments:
Returns: goog.net.IframeIo
The instance of IframeIo.
|
code » | ||||||
No description.
Returns: string
The next iframe name.
|
code » | ||||||
![]()
Handles incremental data and routes it to the correct iframeIo instance.
The HTML page requested by the IframeIo instance should contain script blocks
that call an externed reference to this method.
|
code » | ||||||
![]()
Static send that creates a short lived instance of IframeIo to send the
request.
Arguments:
|
code » | ||||||
No description.
Returns: boolean
Whether we can use readyState to monitor iframe loading.
|
code » |
![]()
Prefix for frame names
|
Code » | |
![]()
The number of milliseconds after a request is completed to dispose the
iframes. This can be done lazily so we wait long enough for any processing
that occurred as a result of the response to finish.
|
Code » | |
![]()
Suffix that is added to inner frames used for sending requests in non-IE
browsers
|
Code » | |
![]()
Counter used when creating iframes
|
Code » | |
![]()
Form element to post to.
|
Code » | |
![]()
Object used as a map to lookup instances of IframeIo objects by name.
|
Code » | |
![]()
No description.
|
Code » |