-
Notifications
You must be signed in to change notification settings - Fork 4
API: Basic methods
Except where otherwise stated, all methods return the AOMI object itself, to allow method chaining.
A shortcut for document(). This is analagous to the jQuery method $.(), which returns the global document object.
Returns a set of elements from the iframe’s document body, matching the CSS selector.
This identical to: jQuery(selector, aomi.body())
Returns the iframe’s window object, wrapped in a jQuery object.
If the window object cannot be accessed (e.g. because the iframe is not in the DOM, or the iframe is displaying a document from a different domain), then an an empty jQuery collection, with zero length, is returned.
Returns the iframe’s document object, wrapped in a jQuery object.
If the document object cannot be accessed (e.g. because the iframe is not in the DOM, or the iframe is displaying a document from a different domain), then an an empty jQuery collection, with zero length, is returned.
Re-creates the iframe document, in the same way as a call to $.iframe(headContents, bodyContents, options, callback).
Returns the body element of the iframe’s document, wrapped in a jQuery object.
If the body element cannot be accessed (e.g. because the iframe is not in the DOM, or the iframe is displaying a document from a different domain), then an an empty jQuery collection, with zero length, is returned.
-
contentswill be appended to the iframe’sbodyelement. May be an HTML string, DOM node, jQuery collection, or selector. -
emptyFirstis an optional boolean (defaultfalse). Iftrue, the body element will first be emptied of all child nodes.
Returns the head element of the iframe’s document, wrapped in a jQuery object.
If the head element cannot be accessed (e.g. because the iframe is not in the DOM, or the iframe is displaying a document from a different domain), then an an empty jQuery collection, with zero length, is returned.
-
contentswill be appended to the iframe’sheadelement. May be an HTML string, DOM node, jQuery collection, or selector. -
emptyFirstis an optional boolean (defaultfalse). Iftrue, the head element will first be emptied of all child nodes.
Appends a new <style> element to the iframe document’s head, using the cssText as the style contents.
The following methods can be used in a similar way to the standard jQuery manipulation methods . All of them return the AOMI object.
Methods to manipulate the iframe element:
- appendTo()
- prependTo()
- insertBefore()
- insertAfter()
- replaceAll()
Methods to manipulate the iframe document’s body:
- append()
- prepend()
- html()
- text()
- wrapInner()
- empty()