Skip to content

API: Advanced methods

premasagar edited this page Sep 13, 2010 · 11 revisions

hasExternalDocument()

Returns true if the iframe contains a document that is from an external resource (either from the same domain, or not), as opposed to a document that has been created by JavaScript on-the-fly, or a null document (due to the iframe being out of the DOM, or the document never having been created). Otherwise false.

isSameDomain()

Returns true if the iframe contains a document that either a) has been created by JavaScript on-the-fly, or b) is from an external resource from the same domain as the host document. In such cases, JavaScript from the host document has full rights to read from and write to the iframe’s document. Otherwise false.

hasBlankSrc()

Returns true if the iframe element has a src attribute of "about:blank", or a blank string, or null. Otherwise false.

title()

Returns the iframe document’s title property.

title(newTitle)

Sets the iframe document’s title property.

doctype()

Returns the iframe document’s doctype string, e.g. <!DOCTYPE html>.

doctype(htmlVersion)

Uses the htmlVersion to determine the doctype that will be used when the iframe document is created.
The default is the HTML5 doctype: aomi.doctype(5).

location()

Returns the iframe window’s location, if it can be determined (this will happen if the iframe is in the DOM and it has a document from the same domain as the host document). If not, then the method will either return the iframe element’s src attribute (if the iframe is out of the DOM and has a document from the same domain as the host document), or otherwise null.

restore()

options()

reload()

clone()

replace()

repaint()

Clone this wiki locally