如果iframe src無(wú)法加載,則會(huì)出現(xiàn)捕獲錯(cuò)誤。錯(cuò)誤: - “拒絕在框架中顯示'http://www.google.co.in/'..”我Knockout.js用來(lái)綁定iframe src標(biāo)簽(這可以根據(jù)用戶進(jìn)行配置)?,F(xiàn)在,如果用戶已配置http://www.google.com(我知道它不會(huì)在iframe中加載,這就是為什么我將它用于-ve場(chǎng)景)并且必須在IFrame中顯示。但它會(huì)引發(fā)錯(cuò)誤: -拒絕在框架中顯示“ http://www.google.co.in/ ”,因?yàn)樗鼘ⅰ癤-Frame-Options”設(shè)置為“SAMEORIGIN”。我為iframe提供了以下代碼: -<iframe class="iframe" id="iframe" data-bind="attr: {src: externalAppUrl, height: iframeheight}">
<p>Hi, This website does not supports IFrame</p></iframe>我想要的是,如果網(wǎng)址無(wú)法加載。我想顯示自定義消息。 騙子在這里現(xiàn)在,如果我使用onload和onerror作為: -<iframe id="browse" style="width:100%;height:100%" onload="alert('Done')" onerror="alert('Failed')"></iframe>它可以正常加載w3schools.com,但不能與google.com。其次: - 如果我把它作為一個(gè)功能,并嘗試像我在我的小提琴,它不起作用。<iframe id="browse" style="width:100%;height:100%" onload="load" onerror="error"></iframe>我不知道如何讓它運(yùn)行并捕獲錯(cuò)誤。
如果iframe src無(wú)法加載,則會(huì)出現(xiàn)捕獲錯(cuò)誤。錯(cuò)誤: - “拒絕在框架中顯示
喵喵時(shí)光機(jī)
2019-12-02 08:04:34