iframe

Embed PDF in mobile browsers

天大地大妈咪最大 提交于 2020-01-13 13:57:14
问题 I have the code below which is a perfect solution to what I need, which would essentially be embedding any of JPG, GIF, PNG or PDF files in my webpages. It works perfectly in PC browsers, but a critical requirement for the pages is to have them compatible in mobile browsers due to its target users. <iframe src="uploads/test1.pdf" width="auto" height="auto"> </iframe> Although image files work fine, PDF files are opened separately in the mobile browser and not embedded inline in the web page.

IE8 reloads dynamic iframe content from cache into the wrong iframe

家住魔仙堡 提交于 2020-01-13 11:24:06
问题 I have a page with multiple iframes on it. Each iframe is invoking some javascript which dynamically writes new iframes into the parent window's document. This works fine on first page load. But if the page is refreshed in IE8 (and earlier) one of the dynamically generated iframes will get loaded from cache into one of the hard-coded slots on the parent page. See the following example: http://www.risingspiral.com/ie8-iframe-refresh/ On refresh in IE8 (may take a couple tries) the Spot 2_ will

Is window.frameElement (for same-origin iframes) supported across all browsers?

二次信任 提交于 2020-01-13 10:05:40
问题 I have googled as much as I can and I'm not sure of the support for the document of an iframe getting the id of itself in the parent window: window.frameElement.id . There are so many browsers that it's hard to test them all and nothing online seems to have any information. I'm specifically wondering about: Safari iOS Safari Windows Phone IE IE 7, 8, 9, 10, 11 (I tested Firefox and Chrome and they both worked). EXAMPLE IFRAME CONTENT <!DOCTYPE HTML> <html> <head></head> <body> <script type=

Are there drawbacks to credit card payment forms via an iframe? [closed]

大城市里の小女人 提交于 2020-01-13 09:57:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . A common feature I see in a lot of small business ecommerce websites is that when I click on the CHECKOUT button, I am taken away from the website and redirected to the url of a 3rd party payment gateway like paypal, authorize.net etc... After I make my payment on this 3rd party site, I am redirected back to the

Setting iframe height to scrollHeight in ReactJS

江枫思渺然 提交于 2020-01-13 09:09:48
问题 The typical solution to the problem doesn't work in in React due to its dynamically generated component structure and event model, as opposed to traditional static HTML: script: <script> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> html: <iframe src="..." frameborder="0" scrolling="no" onload="resizeIframe(this)" /> There is a npm package react-iframe , but it looks unfinished (accepts only props url , width , height ): https

opening modal window from iFrame into parent window

南笙酒味 提交于 2020-01-13 06:18:10
问题 I need some help appending a modal from an iFrame to it's parent body. I've heard about the jQuery plugin SimpleModal and even tried it, but failed. So I have a page with an iFrame and inside this iFrame there is a button that should open a modal window in the parent window. The problem is that I don't have access to put code into the parent window. I just have access to the iFrame. For any kind of help, I'm very thankful! 回答1: Without any example code, it's kinda hard to show you per your

Avoiding memory leaks loading content into an iframe

旧巷老猫 提交于 2020-01-12 08:43:32
问题 I am working on an embedded system that presents content in an iframe. It uses signalR (which is based on ajax) and jquery. The browser gets slower and slower, and the memory usage goes up and up, as the hours go by. So I am looking to remove all potential memory problems. When the new page is loaded into the iframe, I attach click and focus event handlers. Just before the iframe page is to be replaced, I un-attach them. However, if I inspect $.cache (while testing on a PC with firefox, so

How can I target a div inside an iframe?

旧时模样 提交于 2020-01-12 05:33:07
问题 I have an element inside an <iframe> I'd like to activate using a link outside the <iframe> . Example: <iframe src="iframe.html" id="iframe"> *inside the iframe* <div id="activate" class="activate"> </iframe> <a href="#activate" target="iframe">Link</a> I thought this would work but obviously does nothing because I'm stupid. Any ideas? 回答1: Framed page ( test.html ): ....... lots of content .... <div id="activate">Inside frame</div> Page containing the frame ( page-containing-frame.html ):

javascript - postMessage to sandboxed iframe, why is recipient window origin null?

。_饼干妹妹 提交于 2020-01-12 04:40:10
问题 2 postMessage calls in the test: 1 using an asterisk for targetOrigin, one using the same https url of both the parent and child documents. button 1: $('.iframed')[0].contentWindow.postMessage( messageData , '*' ); button 2: $('.iframed')[0].contentWindow.postMessage( messageData , 'https://myurl.net' ); the iframe element in parent html document, which points to child html file on same domain, in same directory: <iframe name="childFrame" class="iframed" src="child.html" sandbox="allow

Safari and php sessions not working in facebook iframe

馋奶兔 提交于 2020-01-12 02:22:12
问题 I'm having a problem to make my facebook app working on Safari. The issue is related to the PHP session variables. I am aware that Safari has a problem dealing with cross domain sessions (inside an iframe) and i found around 2 types of solutions: Setting the p3p header: i've tried many p3p header found around but no one of them worked [for example: header('P3P: CP="NOI ADM DEV COM NAV OUR STP"'); ]. Sending a post to the iframe, using javascript. This creates interaction and sessions should