iframe

Safari doesn't call iframe onload when src is not valid site

人盡茶涼 提交于 2019-12-13 16:26:28
问题 For the following iframe, Safari never calls the onload function and doesn't display anything in the iframe. All other browsers I've tested do call onload and display a default error web page. <html> <body> <iframe src="http://www.asdkjhjhkjhkjhjhjhfhkjhsdflkjahdsjfhasf.com" onload="alert('iframe loaded');"> </iframe> </body> </html> Why is this happening? If there is no solution to this problem, then I need to find a way to detect if an iframe fails to load. 回答1: I just the other day

How to Stop Gmail from maximizing an iFrame?

扶醉桌前 提交于 2019-12-13 16:24:24
问题 I am trying to create a webpage with Gmail embedded in an iframe. However, Gmail has some javascript code that executes whenever it is loaded. I believe the following js code snippet is what causes Gmail to hijack the window and maximize itself, destroying my parent iframe: if (top.location != self.location) { top.location = self.location.href; } Preferably, I am looking for a solution that works cross-browser (and does not involve greasemonkey, or some other browser-based hack). If jquery

jQuery Event when New Page Loads in iFrame

风格不统一 提交于 2019-12-13 16:23:43
问题 I'm trying to set up an event on the parent that gets triggered when an iframe loads a new page (likely via the user clicking a link). HTML: <iframe name="posts" id="posts" src="edit.php"> JS: $(document).ready(function() { $('iframe#posts').live('load', function() { console.log('live'); }); }); The problem is that the console.log() statement never gets triggered. How can I achieve what I'm trying to do? 回答1: My best guess is that the 'load' event on the iframe has fired before the 'ready'

backbone.js router doesn't work on IE6

江枫思渺然 提交于 2019-12-13 16:21:37
问题 When I use the Router in Backbone.js, IE6 throw a Permission Denied on the following line: if (this.iframe && (frag != this.getFragment(this.iframe.location.hash))) the Backbone.js version is 0.5.3 , I also try some other version, but it is not work also. 回答1: The Backbone.js router does work in IE6, but it uses hash fragment routing (http://domain/#route) instead of HTML5 history push state routing (http://domain/route) 回答2: As far as I know backbone.js does not claim to support IE6 来源:

Want to understand iframe breakout code

久未见 提交于 2019-12-13 16:14:41
问题 With this script code (below) placed in between the head tags, I am told that this will not allow the page to load in an iframe. If this is correct, is there anything that needs to be replaced with my custom URL or similar in this code (e.g., top.location should be top.myurl )? Or do you leave it as it is, and just paste it in the head of the page? I'm trying to understand how this works. if (top.location!= self.location) { top.location = self.location.href } 回答1: This code will work if it is

Unable to hide youtube iframes in safari?

拜拜、爱过 提交于 2019-12-13 16:10:34
问题 I've noticed that when using any typical method of hiding a div does not work in safari when a youtube video is in it. Look at this basic webpage- <!DOCTYPE html> <html> <head><title>Safari Test</title></head> <body> <div id="test"> <iframe width="560" height="315" src="http://www.youtube.com/embed/Nry5zSJxG9k" frameborder="0" allowfullscreen></iframe> </div> <div id="safari" style="display: none;"> <iframe width="560" height="315" src="http://www.youtube.com/embed/Nry5zSJxG9k" frameborder="0

HTML mini browser back button disabling

走远了吗. 提交于 2019-12-13 15:58:46
问题 i have the following webpage: <!Doctype html> <html> <head> <script> function display(value){ document.getElementById('displayer').src=value; return false; } </script> </head> <body> <form name="x" onsubmit="return display(this.y.value)"> <input name="y" /><input type="submit" value="display"/> </form> <iframe id="displayer">ERROR</iframe> <button onclick="document.getElementById('displayer').contentWindow.history.back()">Click me to go back in the history of iframe!</button> </body> </html>

How to stop javascript ajax requests in inactive Iframe?

半世苍凉 提交于 2019-12-13 15:44:11
问题 I have made Website, where various other pages are built-in as "apps" with i frames: <iframe id="frame1" src="./app1.php"> <iframe id="frame2" src="./app2.php"> In these apps, there is javascript code executed, among others very high-frequent HTTP-Requests. $('#app1button').click(function () { //Here i have to stop the HTTP-Requests which where fired from the JS of App2 hideAllApps(); showApp(app1); }); app1 is polling information from a server very high frequently: app1.php has Javascript in

How To Select A Range in an Iframe With “Start” and “End” in Firefox like “selectionStart” from inputs element

為{幸葍}努か 提交于 2019-12-13 15:24:17
问题 for Internet Explorer, I have the current code to select a range in an iframe with desingMode setting to on: var Range = window.document.selection.createRange(); var obj = { start: 3 , end : 6 } Range.collapse( true ); Range.moveStart( 'character', obj.start ); Range.moveEnd( 'character', obj.end - obj.start ); Range.select(); Most useful if I want select only one piece of a string by only 2 parameters. Start and End ( for input elements exists the properties selectionStart and selectionEnd )

iframe Google maps won't print in chrome

拜拜、爱过 提交于 2019-12-13 15:13:46
问题 Since the latest Google maps update, I'm unable to print the map via my chrome browser. If I try to print it with firefox, and have a look at the preview, the map shows up. My code: <iframe width="600" height="300" marginheight="0" src="http://maps.google.com/maps?ie=UTF8&q=loc:{address} {number}@{latitude},{longitude}&z=14&output=embed&iwloc=near" frameborder="0" marginwidth="0" scrolling="no"> </iframe> It displays the following (in chrome): And if I try to print it, I get: While in Firefox