天道酬勤,学无止境

iframe

iframe onload in chrome vs IE11

I've been writing my first webapp using Chrome (because of the neat built-in Inspect tool) and all was fine until I tested in IE11 . It's basically a form & iframe that is used for uploading a file (but in the snippet I've just focused on minimal reproduction of the behavior by cutting all that out). The behavior is that in Chrome I click "Submit" and the form triggers the iframe onload event and run some code. In IE11, the onload fires as the page is loaded, and when Submit button is clicked, it fires twice. It seems like I should be using some other event handler, but not sure what to catch

2021-10-24 04:05:14    分类:问答    html   forms   iframe   internet-explorer-11

引用另一个页面并更改 iframe 内容(Referencing another page and change the iframe content)

问题 我正在尝试使用我的主页来引用另一个页面,并使用 JavaScript 更改该页面 iframe 中的内容及其标题。 当我已经在页面中时,我可以更改内容,但是当我从主页引用时,它不会更改 iframe 的内容。 EntryForm.html 是“主表单页面”,当用户单击主页上的按钮时,它需要能够更改 iframe 的内容和标题。 任何帮助表示赞赏。 主页 html 页面 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"content="HTML,CSS,XML,JavaScript"> <script src="Scripts/jquery.js" type="text/javascript"></script> <script src="Scripts/Global.js"></script> <script type="text/javascript" src="lib/d3.js"></script> <script type="text/javascript" src="Scripts/gauge.js"></script> <link rel="stylesheet" type="text/css" href="Styles/Design.css"> </head> <body onload="initialize

2021-10-24 03:43:09    分类:技术分享    javascript   html   iframe   javascript-events

如何切换到 iFrame,在 Selenium 中不起作用(How to switch to iFrame, not working in Selenium)

问题 我试图点击 iframe 中的一个对象,但由于某种原因我无法切换帧。 这是我用来切换帧的代码: driver.switch_to.frame(frame_reference=driver.find_elements_by_xpath('//* [@id="practice_schedule"]')) 这是 HTML 路径: 任何解决方案? 回答1 .find_elements_by_xpath返回列表,从中删除s ,你想要的是.find_element_by_xpath来选择第一个元素。

2021-10-24 03:19:21    分类:技术分享    python   selenium   xpath   iframe   selenium-chromedriver

在 iFrame 中将两个 contentWindows 打印为一个(Print two contentWindows as one within an iFrame)

问题 我有一个包含多个 iFrame 的网页,例如 6,我希望能够将其中的 2 个帧作为一次调用打印,而不是抓取每个帧的 contentWindow 然后调用: parent.iFrame1.focus(); parent.iFrame1.print(); parent.iFrame2.focus(); parent.iFrame2.print(); 因为它在浏览器的两个单独的打印预览窗口中打印内容。 我尝试了以下但没有一个真正给我我正在寻找或为我工作(即内容被截断) 是否有可能做到或者我正在击败一匹死马? 我还尝试从 iframe 中抓取 html 并将其写入新文档,但感觉这有点笨手笨脚。 还有多个 css 和脚本文件等需要合并以呈现一个有凝聚力的页面。 任何答案将不胜感激! 我尝试过但目前还没有奏效的潜在解决方案: 在调用 window.print() 之前等待 html 写入窗口 从多个 iframe 打印预览? https://graciesdad.wordpress.com/2007/04/19/all-in-one-printing-from-multiple-iframes/ Javascript 仅打印 iframe 内容 回答1 我会使用另一个 iframe 来完成这项工作。 该 iframe必须在同一个域中。 在您的主页(例如 mydomain/index

2021-10-24 02:30:45    分类:技术分享    javascript   html   iframe   printing   dojo

trigger javascript event from within an iFrame

I am not sure if this is possible but I have a small web application that is responsible for uploading files to the server. This app is used by another app which includes it in an iFrame. The uploader app is using jQuery form to submit the file in the background and I would like to be able to notify the parent app when the upload is complete and the success callback fires. I was thinking about somehow passing a function into the iFrame app that could be called from the parent but I am not sure how to do this or if it is even possible.

2021-10-24 01:55:15    分类:问答    javascript   jquery   jquery-plugins   iframe

ASP.NET webAPI <--> Dojo 上传器响应格式错误(ASP.NET webAPI <--> Dojo uploader response format is wrong)

问题 我在使用 dojo 上传文档时遇到问题。 我正在使用 dojox/form/Uploader 以 iframe 模式上传文件。 上传后,服务器会以特殊格式响应。 上传器仅在我这样发送时才有效: 服务器:'{"name":"file.png","file":"filename","type":"form-data"}' 但答案是: Client: "'{\"name\":\"file.png\",\"file\":\"filename\",\"type\":\"form-data\"} '" 所以我认为有两种可能的方法可以解决这个问题: A. 在客户端修复 B. 在服务器端修复 我找不到 B 的解决方案。我正在使用 ASP.NET webAPI 并创建这样的响应: Dim msg = "<textarea>'{" + Chr(34) + "name" + Chr(34) + ":" + Chr(34) + fileName + Chr(34) + "," + Chr(34) + "file" + Chr(34) + ":" + Chr(34) + returnData.Item1 + Chr(34) + "," + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + returnData.Item3 + Chr(34) + "}'<

2021-10-24 01:24:06    分类:技术分享    javascript   iframe   asp.net-web-api   upload   dojo

TinyMCE add div around in the body from the iframe

I use the TinyMCE. The textarea create the tiny-editor. And the tiny-code create the iframe and in this iframe is the editor. So is it normal! But now I want a div around the editor, in the body of the iframe. Is there an option to solve my problem? enter image description here

2021-10-23 23:48:19    分类:问答    html   iframe   tinymce

ASP.NET webAPI <--> Dojo uploader response format is wrong

i have a problem with uploading documents with dojo. I´m using the dojox/form/Uploader to upload a file withiframe mode. After uploading there is a response from the server in a special format. The uploader only works when i send it like this: Server: '{"name":"file.png","file":"filename","type":"form-data"}' But the answer is: Client: "'{\"name\":\"file.png\",\"file\":\"filename\",\"type\":\"form-data\"}'" So i think there are two possible ways to solve this problem: A. Fixing it on the client side B. Fixing it on the server side I could not find a solution for B. I´m using ASP.NET webAPI and

2021-10-23 23:45:28    分类:问答    javascript   iframe   asp.net-web-api   upload   dojo

加载新内容时调整 iframe 的高度(Adjust height of iframe when new content is loaded)

问题 我的 HTML 中包含一个 iFrame,可在页面加载时使用。 当页面第一次加载时,iFrame 没有 content/src。 我正在使用 jQuery 动态地将内容插入到 iFrame 中。 当用户单击我页面上的链接时,iFrame 的内容会更新。 所有这些都对我有用。 但是,当加载新内容时,我正在努力调整 iFrame 的高度。 我在 Stack Overflow 上尝试了几种解决方案,但没有成功。 这是我的 iFrame 代码: <iframe id="myframe" width="100%" frameborder="0"></iframe> 这是我的 jQuery,它更改了 iFrame 中的 HTML: emailOpened.find('#myframe').contents().find('body').html(email.body); 这对我有用。 我只需要我的 iFrame 根据被注入的内容的高度来调整它的高度。 我在这部分的所有尝试中都失败了。 更新 这是我的新 HTML: <iframe id="myframe" width="100%" frameborder="0"> <body onload="parent.resizeIframe(document.body.scrollHeight);"> </iframe> 回答1

2021-10-23 23:17:47    分类:技术分享    javascript   jquery   html   iframe

Referencing another page and change the iframe content

I am trying to use my Home Page to reference another page and change the content in the iframe of that page and its title using JavaScript. I can change the content when I already am in the page, but when I reference from the home page, it wont change the content of the iframe. EntryForm.html is the 'master form page' that needs to be able to change the content of the iframe and the title based off when the user clicks the button from the home page. Any help is appreciated. Home html Page <!DOCTYPE html> <html> <head> <meta charset="UTF-8"content="HTML,CSS,XML,JavaScript"> <script src="Scripts

2021-10-23 22:00:10    分类:问答    javascript   html   iframe   javascript-events