HTMLIFrameElement
åºçº¿
广æ³å¯ç¨
*
èª 2015å¹´7æ èµ·ï¼æ¤ç¹æ§å·²å¨ä¸»æµæµè§å¨ä¸å¾å°æ¯æï¼å¯å¨å¤§å¤æ°è®¾å¤åæµè§å¨çæ¬ä¸æ£å¸¸ä½¿ç¨ã
* æ¤ç¹æ§çæäºé¨åçæ¯æç¨åº¦å¯è½ææä¸åã
HTMLIFrameElement æ¥å£æä¾äºé¤ HTMLElement ä¹å¤çä¸äºç¹æ®å±æ§åæ¹æ³ï¼å½ç¶ä¹å
æ¬äºç»§æ¿èª HTMLElement çé¨åï¼ãè¿äºæ¹æ³ç¨äºæä½å
è frame å
ç´ çå¸å±åå±ç¤ºã
屿§
ç»§æ¿äºæ¥èªç¶ç±»ç屿§ï¼HTMLElementã
HTMLIFrameElement.align-
ä¸ä¸ª
Stringæå®äºç¸å¯¹äºå½åä¸ä¸æç坹齿¹å¼ã HTMLIFrameElement.allowfullscreen-
ä¸ä¸ª
Booleanæ è¯äºè¯¥å è frame æ¯å¦æ¿æè¢«å ¨å±é²æ¢ã详æ 请åè Using full-screen mode ã HTMLIFrameElement.contentDocumentåªè¯»-
è¿åä¸ä¸ª
Documentï¼è¯¥å è frame åµå¥çæµè§ä¸ä¸æä¸æ´»è·ç document 对象ã HTMLIFrameElement.contentWindowåªè¯»-
è¿åä¸ä¸ª
WindowProxyï¼è¯¥åµå¥çæµè§ä¸ä¸æä¸ç window 代çã HTMLIFrameElement.frameBorder-
ä¸ä¸ª
Stringæ è¯äºæ¯å¦å¨ frame ä¹é´å建边æ¡ã HTMLIFrameElement.height-
ä¸ä¸ª
Stringåæ çheightHTML 屿§ï¼æ è¯äºè¯¥ frame çé«åº¦ã HTMLIFrameElement.longDesc-
ä¸ä¸ª
Stringå å«ç该 frame çè¯¦ç»æè¿°ç URIã HTMLIFrameElement.marginHeight-
ä¸ä¸ª
Stringï¼è¯¥ frame çå¤è¾¹è·é«åº¦ã HTMLIFrameElement.marginWidth-
ä¸ä¸ª
Stringï¼è¯¥ frame çå¤è¾¹è·å®½åº¦ã HTMLIFrameElement.name-
ä¸ä¸ª
Stringåæ çnameHTML 屿§ï¼å å«çç¨æ¥å¼ç¨è¯¥ frame çååã HTMLIFrameElement.referrerPolicy-
ä¸ä¸ª
Stringåæ çreferrerpolicyHTML 屿§ï¼æ è¯äºè·åå ³èèµæºæ¶è¦ä½¿ç¨åªä¸ª referrerã HTMLIFrameElement.sandbox-
ä¸ä¸ª
DOMSettableTokenListåæ çsandboxHTML 屿§ï¼æç¤ºç对åµå¥å 容é¢å¤çéå¶ã HTMLIFrameElement.scrolling-
ä¸ä¸ª
Stringæç¤ºçæµè§å¨æ¯å¦åºè¯¥ä¸ºè¯¥ frame æä¾æ»å¨æ¡ã HTMLIFrameElement.src-
ä¸ä¸ª
Stringåæ çsrcHTML 屿§ï¼å å«è¢«åµå ¥å 容çå°åã HTMLIFrameElement.srcdoc-
ä¸ä¸ª
Stringï¼è¡¨ç¤ºè¯¥ frame ä¸è¦æ¾ç¤ºçå 容ã HTMLIFrameElement.width-
ä¸ä¸ª
Stringåæ çwidthHTML 屿§ï¼æ è¯ç该 frame ç宽度ã
æ¹æ³
ç»§æ¿äºæ¥èªç¶ç±»ç屿§ï¼HTMLElementã
æµè§å¨ API æ¹æ³
ä¸ºæ¯ææµè§å¨<iframe>çéæ±ï¼HTMLIFrameElementå·²ç»æ©å±äºä¸äºæ°çæ¹æ³æ¥è®©<iframe>ææ´å¤çè½åãä»ä»¬å¹¶æªæä¸ºè§èï¼åè§ Browser compatibilityï¼ã
å¯¼èªæ¹æ³
以ä¸å¯¼èªæ¹æ³å
许éè¿<iframe>çæµè§åå²è¿è¡å¯¼èªãä»ä»¬å¯¹äºåéãåè¿ã忢åéæ°å è½½æé®çå®ç°èè¨æ¯é常å¿
é¡»çã
HTMLIFrameElement.reload()-
éæ°å è½½
<iframe>å ç´ å 容ã HTMLIFrameElement.stop()-
忢å è½½
<iframe>å ç´ å 容ã HTMLIFrameElement.getCanGoBack()-
æç¤ºæ¯å¦å¯ä»¥åéã
HTMLIFrameElement.goBack()-
æ¹å
<iframe>ä½ç½®å°ä¸ä¸ä¸ªæµè§åå²è®°å½çä½ç½®ã HTMLIFrameElement.getCanGoForward()-
æç¤ºæ¯å¦å¯ä»¥åè¿ã
HTMLIFrameElement.goForward()-
æ¹å
<iframe>ä½ç½®å°ä¸ä¸ä¸ªæµè§åå²è®°å½çä½ç½®ã
ç®¡çæ¹æ³
è¿ä¸ªæ¹æ³éç®¡çæµè§å¨<iframe>æç¨çèµæºãå®ä»¬å¯¹äºå®ç°å页æµè§ç¨åºé常æç¨ã
HTMLIFrameElement.executeScript()-
卿µè§å¨
<iframe>页é¢å è½½å®æåæ§è¡æå®çèæ¬ã HTMLIFrameElement.purgeHistory()-
æ¸ çææä¸æµè§å¨
<iframe>æå ³çèµæºï¼ä¸å æ¬ cookieï¼ã HTMLIFrameElement.setVisible()-
ä¿®æ¹æµè§å¨
<iframe>çå¯è§æ§ãè¿ä¼å½±åèµæºåé åä¸äºå½æ°çèµæºå ç¨çï¼å¦requestAnimationFrameã HTMLIFrameElement.getVisible()-
æç¤ºå½åæµè§å¨
<iframe>çå¯è§æ§ã HTMLIFrameElement.setActive()-
设置å½å
<iframe>ä¸ºæ´»å¨ frameï¼å¯¹è¿ç¨ç®¡çå¨å¦ä½ååä¼å 级æå½±åã HTMLIFrameElement.getActive()-
æç¤ºå½åæµè§å¨
<iframe>æ¯å¦ä¸ºå½åæ´»å¨ç frameã HTMLIFrameElement.setInputMethodActive()-
设置å½åæµè§å¨
<iframe>æ¯æ´»å¨çè¾å ¥æ³ç¼è¾å¨çªå£èå ¶ä»ä¸æ¯ãå½ä¸ä¸ªé¡¶å±åºç¨å¸ææ¿æ´»ä¸ä¸ªçªå£ä½ä¸ºè¾å ¥æ³ç¼è¾å¨ï¼å¦é®çï¼æ¶æç¨ã HTMLIFrameElement.setNfcFocus()-
Firefox æä½ç³»ç» NFC API çä¸é¨åï¼æ©å±äºBrowser APIï¼è¿ä¸ªéå设置æµè§å¨
<iframe>æ¯å¦å¯ä»¥æ¥æ¶ä¸ä¸ªNFCäºä»¶ã
é³é¢ç¸å ³æ¹æ³
以䏿¹æ³å è®¸ç´æ¥æ§å¶æµè§å¨å ç´ ç声é³ã
HTMLIFrameElement.getVolume()-
è·åæµè§å¨
<iframe>å½åé³éã HTMLIFrameElement.setVolume()-
设置æµè§å¨
<iframe>å½åé³éã HTMLIFrameElement.mute()-
æµè§å¨
<iframe>ææ¾çææé³é¢éé³ã HTMLIFrameElement.unmute()-
åæ¶æµè§å¨
<iframe>ææ¾ææé³é¢çéé³ã HTMLIFrameElement.getMuted()-
æç¤ºå½åæµè§å¨
<iframe>å½åæ¯å¦è¢«éé³ã
Search methods
New methods are provided to allow programmatic searches of browser <iframe>s to be carried out.
HTMLIFrameElement.findAll()-
Searches for a string in a browser
<iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted. HTMLIFrameElement.findNext()-
Highlights the next or previous instance of a search result after a
findAll()search has been carried out. HTMLIFrameElement.clearMatch()-
Clears any content highlighted by
findAll()orfindNext().
Event-related methods
In order to manage the browser <iframe>'s content, many new events were added (see below). The following methods are used to deal with those events:
- The
<iframe>gains support for the methods of theEventTargetinterface -
addEventListener(),removeEventListener(), anddispatchEvent(). HTMLIFrameElement.sendMouseEvent()-
Sends a
MouseEventto the<iframe>'s content. HTMLIFrameElement.sendTouchEvent()-
Sends a
TouchEventto the<iframe>'s content. Note that this method is available for touch enabled devices only. HTMLIFrameElement.addNextPaintListener()-
Defines a handler to listen for the next
MozAfterPaintevent in the browser<iframe>. HTMLIFrameElement.removeNextPaintListener()-
Removes a handler previously set with
addNextPaintListener().
Utility methods
Last, there are some utility methods, useful for apps that host a browser <iframe>.
HTMLIFrameElement.download()-
Downloads a specified URL, storing it at the specified filename/path.
HTMLIFrameElement.getContentDimensions()-
Retrieves the X and Y dimensions of the content window.
HTMLIFrameElement.getManifest()-
Retrieves the manifest of an app loaded in the browser
<iframe>and returns it as JSON. HTMLIFrameElement.getScreenshot()-
Takes a screenshot of the browser
<iframe>'s content. This is particularly useful to get thumbnails of tabs in a tabbed browser app. HTMLIFrameElement.getStructuredData()-
Retrieves any structured microdata (and hCard and hCalendar microformat data) contained in the HTML loaded in the browser
<iframe>and returns it as JSON. HTMLIFrameElement.zoom()-
Changes the zoom factor of the browser
<iframe>'s content. This is particularly useful for zooming in/out on non-touch-enabled devices.
Specifications
| è§è |
|---|
| HTML > # htmliframeelement > |
Browser compatibility
See also
- The HTML element implementing this interface:
<iframe>