iframe如何刷新的三種實現(xiàn)方案
來源:易賢網 閱讀:1397 次 日期:2016-06-21 11:43:57
溫馨提示:易賢網小編為您整理了“iframe如何刷新的三種實現(xiàn)方案”,方便廣大網友查閱!

iframe如何刷新一直都被網友所關注,接下來為大家詳細介紹下三種:用iframe的name屬性定位/id屬性定位/當iframe的src為其它網站地址時,感興趣的朋友可以參考下

代碼如下:

<iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe>

方案一:

用iframe的name屬性定位

代碼如下:

<input type="button" name="Button" value="Button" onclick="document.frames('ifrmname').location.reload()">或

<input type="button" name="Button" value="Button" onclick="document.all.ifrmname.document.location.reload()">

方案二:

用iframe的id屬性定位

代碼如下:

<input type="button" name="Button" value="Button" onclick="ifrmid.window.location.reload()">

終極方案:

當iframe的src為其它網站地址(跨域操作時)

代碼如下:

<input type="button" name="Button" value="Button" onclick="window.open(document.all.ifrmname.src,'ifrmname','')">

更多信息請查看網頁制作

2026上岸·考公考編培訓報班

  • 報班類型
  • 姓名
  • 手機號
關于我們 | 聯(lián)系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權所有:易賢網