我可以使用哪些事件侦听器来标识来自firefox插件中的hiddenDOMWindow(或其中的iframe)的请求?例如,在“ http-on-modify-request”事件中发送请求之前,我需要执行此操作. 我尝试过的 >注册全局的“ http-on-modify-request”;但我无法区分源窗口>将侦听器添加到hiddenDOMWindow本身;但我找不到任何加载前事件>将侦听器添加到hiddenDOMWindow.document中;没有加载前事件>将侦听器添加到已创建的hiddenDOMWindow.document.iframe中...
我正在尝试使用此技巧在准备好文档时打开文件下载对话框.相同的技巧对我又一次起作用,但是那一次,在ajax调用之后添加了iframe.这是代码段:<script type="text/javascript">$(document).ready(function() {var url='/my_file_url/';var _iframe_dl = $('<iframe />').attr('src', url).hide().appendTo('body');}); </script>尽管iframe以html代码正确打印,但是却没有预期的行为:加载页面后,没有弹出下载文件.有什么帮助吗?解决方...
这是我的代码:<div id="main-content"><script>document.title = document.getElementById("main-content-iframe").contentDocument.title;</script><iframe name="cstage" src="home.html" width="100%" height="100%" id="main-content-iframe" frameborder="0" onl oad="document.title=parent.frames['cframe'].document.title;">If you're seeing this message, it means IFrames are not supported; Please enable IFrames ...
我正在阅读并寻找几天的答案而找不到答案,希望这个帖子能带来救赎:) 在我的公司,我们有一个正在使用IE8的网络应用程序.我们正在尝试迁移到IE11.我们差不多了,但是,我们有一个旧模块,用旧框架编写,托管在iframe中并以怪异模式运行(使用meta http-equiv =“X-UA-Compatible”content =“IE = emulate7”或IE = 5定义,我试过两个).只要父/主窗口以IE8文档模式(通过x-ua兼容元标记)或企业模式呈现,iframe就可以正常工作. 但是一旦我将父...
我想要跨域JavaScript调用. 1:SiteA:www.sub1.foo.com 2:在SiteA的iframe中打开SiteB:www.bar.com 3:在SiteB中执行某些操作后,通过javascript将一些值从SiteB传递到SiteA. 试试1:我跟着这个article,我跟着#2进行了设置.但我不断收到错误: IE:参数无效 FF:非法的document.domain值. 试试2:跟随这个article. 它适用于FF.我可以使用window.parent.parent.MyFunction()但在IE中我得到“Permission Denied”错误. 尝试3:我甚...
我有一个iframe注入页面,称他为“帮手”.因此,由于相同的原始策略,我需要设置iframe域同样是父窗口域.但我无法访问父窗口域.怎么解决? 更新#1 此代码目前适用于二级域: pathArray = window.location.host.split(‘.’); var arrLength = pathArray.length; var domainName = pathArray.slice(arrLength – 2,arrLength).join(‘.’); document.domain = domainName; 但我需要以某种方式从父窗...
使用html5沙箱iframe时,我希望iframe无法更改其位置:<iframe sandbox="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts" class="iframe visible" src="thesource.html" width="100%" scrolling="auto" frameborder="0"></iframe>它在Chrome中运行良好,但在Firefox中,沙盒iframe仍然可以重定向. 它是一个known bug,但我如何修补它以便所有Firefox用户都不会被重定向?解决方法:例: 有额外限制:<if...
首先,让我说我对完全采用不同方法的想法持开放态度. 我有和iframe这样:<div id="testloadlogin"><iframe src="../security/login.aspx" width="400" height="500"scrolling="auto" frameborder="1">[Your user agent does not support frames or is currently configurednot to display frames. However, you may visit<a href="../security/login.aspx">the related document.</a>]</iframe> </div>使用iframe加载的页面有一个名...
我被卡住了!我正在使用jquery,点击,拉一个youtube json-c feed,抓住第一个id,然后使用它将html5 iframe视频添加到ul的顶部.然后我递增它并拉出第二个id,第三个id等,并相应地添加它们. 问题是,当预先添加新视频时,我希望之前的任何视频都停止播放.他们用javascript / jquery完成这个任何方式吗? 这是函数调用:function videoCall(i) { $.getJSON('http://gdata.youtube.com/feeds/api/standardfeeds/most_recent?v=2&max-results...
我有iframe,内容如下,<iframe frameborder="no" src="http:localhost/com" id="iframe"><div style="height:850px;width:700px;">div text </div></iframe>这显示了带有hori的iframe.和垂直滚动但不是850px内部内容的高度. 如何根据内容高度n宽度动态更改iframe高度.我在内容中使用jquery. 它的跨域js小部件,所以下面的大部分答案抛出权限被拒绝错误 Thanxs,Nithish解决方法:Nithish, 如果您正在使用jquery,那么您可以轻松地找到(...
如何使用Javascript禁用iframe,以便用户无法与iframe的内容进行交互(即滚动,选择,拖动等)?例如,通常可以拖动和缩放iframe中的Google地图.如何防止这些行为?解决方法:如果您想要禁用鼠标交互,这应该可行. 将DIV放在iframe的顶部,就像这样(用您自己的值替换top,left,width和height值):<div id="blank" style="display:none; position:absolute; top:100px; left:100px; width:600px; height:400px;">当你想要禁用iframe时,在javas...
如何将点击事件添加到< p> iframe中的元素(使用jQuery)<iframe frameborder="0" id="oframe" src="iframe.html" width="100%" name="oframe">解决方法:有一个特殊的jQuery函数可以做到这一点:.contents().请参阅示例了解它是如何工作的.
我正在显示加载指示符,而一些外部iframe加载了以下代码:<html><head><title>Loading iframe</title></head><script>function loading_iframe(){document.getElementById('loading_iframe').style.display = "none";document.getElementById('loading').style.display = "";document.getElementById('loading_iframe').onload = function(){document.getElementById('loading').style.display = "none";document.getElementById('l...
示例页面源:<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><title>Page</title> </head> <body> <div class="main" style="height: 100%;"><div class="header" style="height: 100px; background-color: green;"></div><iframe src="http://www.wikipedia.com"style="height: 200px; width: 100%; bo...
我有以下JavaScript代码:$(document).ready(function() {$('a#print_button').click(function(event) {event.preventDefault();var print_url = 'print.html';if ($('#print_page').length == 0) {$("body").append('<iframe id="print_page" name="print_page" src=' + print_url + ' style="display: none; @media print { display: block; }"></iframe>');} else {$('#print_page').attr("src", print_quote_url);}$('#print_p...