iframe

Inserting text into an editable IFRAME at the caret position (IE)

无人久伴 提交于 2019-12-28 16:26:28
问题 I'm struggling with an actually straighforward problem: In Internet Explorer I want to insert plain text at the current caret position. This works really fine for simple TEXTAREA elements but it doesn't entirely work for editable IFRAMEs, which is what I have. In the script I use I am creating a TextRange object from the document of the IFRAME which I use to paste the text as HTML at the cursor position. <iframe id="editable"> <html> <body> Some really boring text. </body> </html> </iframe>

how to refresh an iframe automatically

▼魔方 西西 提交于 2019-12-28 15:21:34
问题 I would like an iframe to refresh itself to the source path specified. What is the easiest way to do this inline with javascript? thanks, 回答1: If you're also perhaps looking for a way of doing this without javascript enabled, and have access to modify the iframe HTML, then you could add this reload code to the <head> tag of the iframe HTML: <meta http-equiv="refresh" content="600"> 回答2: You can use setInterval(function, milliseconds, param1, param2, ...) Something like this: var

how to refresh an iframe automatically

拟墨画扇 提交于 2019-12-28 15:21:28
问题 I would like an iframe to refresh itself to the source path specified. What is the easiest way to do this inline with javascript? thanks, 回答1: If you're also perhaps looking for a way of doing this without javascript enabled, and have access to modify the iframe HTML, then you could add this reload code to the <head> tag of the iframe HTML: <meta http-equiv="refresh" content="600"> 回答2: You can use setInterval(function, milliseconds, param1, param2, ...) Something like this: var

Auto resize iframe height when the height of the iframe contents change (same domain)

青春壹個敷衍的年華 提交于 2019-12-28 13:55:10
问题 I am loading an iframe inside a page, which the length of the content of the iframe will be changed from time to time. I have implemented the following solution. However the height is fixed as the dyniframesize only get call when iframe.onload. It is possible to have the iframe to be resized accordingly from time to time the height of the iframe changed? <iframe src ="popup.html" frameborder="0" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" id="ifm" name="ifm" onload=

Get Cross-Domain iFrame content

僤鯓⒐⒋嵵緔 提交于 2019-12-28 07:06:43
问题 I would like to know how I can get content from an IFrame cross-domain? I have no problem getting content from a non-cross-domain iFrame, but when it's located on another domain, JavaScript doesn't allow access. 回答1: Short of requesting it via a proxy on your own server, you can't. The same origin policy prevents it (and for good reason; I would be very unhappy if you loaded my banking site in your iframe and read all my account details) 回答2: You use Cross Document Messaging, here's an

Make links inside an iframe open in a new window

送分小仙女□ 提交于 2019-12-28 06:53:13
问题 I'm trying to display an map inside an iframe that has a needle which on mouseover shows some information about a certain company, the thing is once you click the link the page opens up inside the iframe which ruins the experience, so i was wondering is it possible to make the links inside an iframe open up in a new window instead perhaps using jquery or something similiar? the code i have atm is http://www.jsfiddle.net/rkd59/1/ Edit: the very least capture a click within the iframe so i

Display PDF in iframe

泄露秘密 提交于 2019-12-28 06:53:11
问题 I have a solution in place for my site that renders a requested PDF document in a full page using the code below. Now my client wants the document rendered within an iframe. I can't seem to get it to work readily, maybe I am missing something obvious. The first code will properly display the PDF in a new window. if (File.Exists(filename)) { //Set the appropriate ContentType. Response.ContentType = "Application/pdf"; Response.WriteFile(filename); Response.End(); } else Response.Write("Error -

Make links inside an iframe open in a new window

戏子无情 提交于 2019-12-28 06:53:09
问题 I'm trying to display an map inside an iframe that has a needle which on mouseover shows some information about a certain company, the thing is once you click the link the page opens up inside the iframe which ruins the experience, so i was wondering is it possible to make the links inside an iframe open up in a new window instead perhaps using jquery or something similiar? the code i have atm is http://www.jsfiddle.net/rkd59/1/ Edit: the very least capture a click within the iframe so i

style content within an iframe

佐手、 提交于 2019-12-28 06:51:07
问题 I have to style something within an iframe. <html> <head> <link href="url/to/my/custom.css"></link> </head> <body> ...... <iframe class="webform-frame">...</iframe> </body> </html> In my custom.css I already tried to use .webform-frame h5 { color: #f00; } but it doesn't work. The iframe is generated by some JavaScript (I have no access to it). Any idea how I could style that stuff within that iframe? 回答1: If you want to target the iframe i.e the border, border color, padding, or margin, then

Print iframe content in Opera and Chrome

扶醉桌前 提交于 2019-12-28 06:36:06
问题 I'm trying to print iframe content. contentWindow.focus(); contentWindow.print(); This code works in IE, Firefox and Safari. But don't work in Chrome and Opera. These browsers print entire page. I tried to use this topic How do I print an IFrame from javascript in Safari/Chrome. But it didn't help me. Could someone help me? 回答1: This is a known bug in Opera. In addition to the above ideas for workarounds, you may want to play with something like this: var clone=document.documentElement