iframe

Prevent loading the content of a hidden iframe

谁都会走 提交于 2019-12-21 03:45:39
问题 I have many hidden <div> tags, with (display: none) , that I call upon when I want to load a jQuery modal. Each of these <div> tags contain an <iframe> which calls a different page. In order to not make my page load painfully slowly, I am wondering if there is a way to prevent the <iframe> from loading the page, until I call the <div> in the modal? 回答1: You can load the iframes after html being rendered by giving empty src in html of iframe and later assigning src by jquery / javascript. Html

Javascript, track iframes redirecting top window

烈酒焚心 提交于 2019-12-21 03:26:09
问题 Since there is no way to prevent an iframe from redirecting the top frame besides sandboxing which prevents other features required for viewability tracking I would like to track redirects. Since one site can have more than one iframe, it could be any of these. Is there any way to track/find out which one (specific iframe) caused the top frame redirect? Here is a sandbox (use browser console and enable preserve log): Note the iframe content is usually cross domain. For ease of use its within

Main web page in standard mode, iframe in compatibility mode: any issues?

柔情痞子 提交于 2019-12-21 03:12:24
问题 We have some legacy HTML content which we must render in compatibility mode. The requirement comes from our customers who want their HTML-based reports (some of which were created back in IE6 days) to look and print exactly the same, regardless of the browser version or underlying technologies. At the same time, we want to use Standard Mode and HTML5 for the rest of our web app. An obvious solution is to host the legacy content in an <iframe> in compatibility mode. The following appears to

Access iFrame URL with JQuery / Javascript

巧了我就是萌 提交于 2019-12-21 03:01:32
问题 I have a page like this... <div> <iframe id="mainContent"> <iframe id="littleBox"> </div> and I want to do this... $(".someButton").live('click', function() { alert(/*The URL That the Main Frame is ON*/); }); I found this: $("#mainFrame").get(0).location.href , but it doesnt work... Also, I need it to return the current url, so if someone navigates around it should return the current page they are on. 回答1: Okay so you mean you have to access the URL of the parent from the child iframe? $("

How do I use frame on ASP.NET page?

白昼怎懂夜的黑 提交于 2019-12-21 00:56:09
问题 How do you correct use frame on a asp.net page, so I have a left frame and a right frame, when I click the links on the page presented in the left frame, it loads the according page in the right frame? On top of this, I need to have a master page on all the right frame's pages. How do I do this? or is there another way to achieve the same effect? Thanks, Ray. 回答1: Yup. Frames are evil. You shouldn't really use them. They cause problems, but in a (very)few edge cases they can be useful and

Youtube Iframe: onYouTubePlayerAPIReady() not called

独自空忆成欢 提交于 2019-12-20 21:53:53
问题 I have a page with an iframe which load a youtube video (the src of iframe is modified in runtime). I based on code by Rob W provided in different answers on this topic <iframe id="browser" class="browser" scrolling="no" name="navigation" src="http://www.youtube.com/embed/nOEw9iiopwI?enablejsapi=1" application="youtube" style="display: inline;"></iframe> Then, when iframe is loaded this code is executed: $('.browser').load(function() { dispose_ytplayer(); }); the called function dispose

iframe 切换

谁说我不能喝 提交于 2019-12-20 20:55:20
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By 1.先找到你要切换的 iframe 的元素 iframe元素 = ‘//iframe[@name=“login_frame_qq”]’ #方法一 driver.switch_to.frame(driver.find_element_by_xpath(’//iframe[@name=“login_frame_qq”]’)) #这个时候进入成功了 下面开始在iframe页面里进行元素操作 driver.find_element_by_id(“switcher_plogin”).click() #方法二 #检测iframe是否可用,然后再切换进来 #用WebDriverWait().until(EC.frame_to_be_available_and_switch_to_it(这个里面传元素定位)) WebDriverWait(driver,10).until(EC.frame_to_be_available_and_switch_to_it(driver

jquery listen for events in an iframe

和自甴很熟 提交于 2019-12-20 20:07:10
问题 I'm making a very simple Rich Text Editor using jquery... I don't want to use a third-party one. I need to listen for events within an iframe (same domain etc), starting with typing. Apparently I'll need to use bind() a lot. This is what I've got at the moment which works fine in IE8 (amazingly enough) but not Chrome. <script> $(function() { $('#text').contents().bind("keyup keydown keypress", function(e) { var code = e.keyCode || e.which; alert(code); return false; }); }); </script> <body>

iframe 父子页面方法调用

人走茶凉 提交于 2019-12-20 18:03:23
在写代码的时候经常会用到将一个网页嵌入到另一个网页中,w3c也规定了一个标签<iframe>,这个标签本身就支持跨域,而且所有的浏览器都支持 iframe具有以下属性: 1、frameborder 设为1代表显示周围边框,设置为0不显示周围边框 2、height 设置iframe的高度 3、width 设置iframe的宽度 4、longdesc 属性值为URL 规定一个页面,该页面包含了有关 iframe 的较长描述 5、marginheight 定义 iframe 的顶部和底部的边距 6、marginwidth 定义 iframe 的左侧和右侧的边距 7、name 规定 iframe 的名称 8、sandbox 启用一系列对 <iframe> 中内容的额外限制。 9、scrolling 设置为 yes 代表显示滚动条,设置为no代表不显示滚动条,设置为auto 代表自动 10、seamless 属性值也是 seamless 规定 <iframe> 看上去像是包含文档的一部分 11、src 规定在 iframe 中显示的文档的 URL 12、srcdoc 规定在 <iframe> 中显示的页面的 HTML 内容 那么在设置好了之后如果在父页面中想要调用子页面的方法,或者在子页面中调用父页面的方法怎么办呢??这个问题网上也很多介绍 父页面 <!DOCTYPE html> <html

detect iframe load error

房东的猫 提交于 2019-12-20 17:39:07
问题 I am loading a user-selected page into an iframe using the src property. If the load fails, I would like to report the problem in terms that will make sense to the user. iframe does not, in general, support onerror according to http://www.w3schools.com/jsref/dom_obj_frame.asp. The page may come from the user's domain, not mine, so I cannot view the content of the iframe. I can set a timeout and cancel it from my onload handler if the load is successful, but it would need to be a long timeout