iframe

trigger Event from iframe

可紊 提交于 2020-01-04 05:44:07
问题 I have two Webparts on a sharepoint site ... thats basicly like haveing two iframes . What I want to do is if there is a change at webpartA , I want to update WebpartB ... what I did so far is at WebpartA I try to trigger a custom event: $("#datain").change(function () { parent.$("document").trigger("datachange" , [$("#datain").val()]); }) At Webpart B I added a Eventlistener : parent.$("document").on('datachange',function (event, data) { $("#dataout").html(data); }); When I change something

How to trigger an iframe event Jquery

旧城冷巷雨未停 提交于 2020-01-04 05:35:21
问题 I have an IFRAME and I want to trigger an event (which is inside the iframe) from the parent of an IFRAME: Just a rough example of what I am trying to do : <iframe id="i"> <div id="test"></div> <script> $(document).ready(function() { // Event is binded inside the iframe $("#test").live({ click : function() { alert("hello"); } }); }); </script> </iframe> <script> $(document).ready(function() { // Want to trigger it from outside the iframe $("#i").contents().find("#test").trigger("click"); });

iFrame Memory Leak in Angular JS and Chrome (noticed in 63 but dates back until at least 58)

让人想犯罪 __ 提交于 2020-01-04 05:27:05
问题 Very simple single page angular application, using an iframe in one of the views / routes, creates a memory leak / constantly increments the document count. This did not happen in the past. It seems to happen on any angular js version using the latest Chrome browsers. Check this plunker: https://plnkr.co/edit/oO6PzzN1YEKTwsOcjRAd: HTML: <html ng-app="project"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.14/angular.js"></script> <script src='https://ajax.googleapis

When did Google Search start sending X-Frame-Options: SAMEORIGIN?

南楼画角 提交于 2020-01-04 05:05:34
问题 I've got an automated test for our application that includes displaying a Google search box in an IFrame. The test started failing recently, when a developer checked in a change that broke several other tests. I'm starting to doubt that the change broke this test, but I'd love to know for sure. As of right now, I can see that Google search ( i.e. , http://www.google.com/search?q=whatever) returns an X-Frame-Options header with SAMEORIGIN , which tells the browser not to display the search

Setting the base tag of a dynamically created iframe

别等时光非礼了梦想. 提交于 2020-01-04 04:44:07
问题 I'm trying to dynamically create an iframe and set it's base tag before it is created. ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "test.html"); ifrm.style.width = 400+"px"; ifrm.style.height = 100+"px"; //before creating it, can we set he base tag? //I.E. <base href="http://example.com/MyFolder/" /> var bt = ifrm.contentDocument.createElement("base"); bt.setAttribute("href", "http://www.example.com/Folder/"); ifrm.contentDocument.getElementsByTagName("head")[0]

Using an iframe in jquery.simplemodal, the iframe reload when the popup is closed

末鹿安然 提交于 2020-01-04 04:37:11
问题 var pt_popup_options = {}; function pt_popup_iframe(sURL, sOkFunction) { pt_popup_okfunction = sOkFunction; $("#pt_msgBox").css('width', '700px'); $("#pt_msgBox").css('heigth', '500px'); $("#pt_msgBox > p").html('<iframe style="width: 696px; height: 496px;" src="' + sURL + '"></iframe>'); $("#pt_msgBox").modal(pt_popup_options); } When the popup is closed via a close button or the "x" top right of the popup, the iframe reloads and make a request to the server. It is not supposed to do that.

iFrame src something other than javascript:false but same effect

可紊 提交于 2020-01-04 04:05:14
问题 Is there any other way to write javascript:false that is more pleasant? I'm building a print functionality for an intranet app (for IE6) and I make the printed page using an iframe: $('body').append('<iframe id="printIFrame" src="javascript:false"></iframe>'); $("#printIFrame").attr('style','position:absolute;left:-500px;top:-500px;'); Without having javascript:false in the src, I'll get the "This page contains both secure and nonsecure items" popup when I create it. However the downside of

how to make iframe with svg “focusable”

放肆的年华 提交于 2020-01-04 03:59:27
问题 I want to detect click on an iframe. The suggested way to do this is to catch blur event on parent window. But when user clicks on svg within an iframe, it doesn't take the focus and the root window does not lose one. Is there a way to force iframe to take focus when user clicks on any content within it? Or detect the click in any other way. Here are two examples. The only difference is iframe src url: Working example: http://plnkr.co/edit/Av6A2dzlfl2K9xYRl1C2 Non-working example: http:/

How to create a new HTMLDocument in IE?

ぐ巨炮叔叔 提交于 2020-01-04 03:51:31
问题 dcoument.implementation.createHTMLDocument [2] is one of the lesser-known DOM methods that (surprise!) creates a brand new HTML document. Unsurprisingly, browser support is rather poor, but I found some workarounds: Use an XLSTProcessor (crazy stuff!) in Firefox < 4 Create an empty iFrame: var iframe = document.createElement('iframe'); iframe.style = 'display: none'; iframe.src = 'data:text/html,<!DOCTYPE html><title></title><body>'; document.body.appendChild(iframe); newHTMLDocument = iframe

前端常见跨域解决方案(全)

前提是你 提交于 2020-01-04 03:24:07
什么是跨域? 跨域是指一个域下的文档或脚本试图去请求另一个域下的资源,这里跨域是广义的。 跨域的根本原因就是浏览器,所以在后台是不存去前端一样上的跨域的,后台调后台是不会跨域的,但是必须网络是通的 广义的跨域: 1.) 资源跳转: A链接、重定向、表单提交 2.) 资源嵌入: <link>、<script>、<img>、<frame>等dom标签,还有样式中background:url()、@font-face()等文件外链 3.) 脚本请求: js发起的ajax请求、dom和js对象的跨域操作等 其实我们通常所说的跨域是狭义的,是由浏览器同源策略限制的一类请求场景。 什么是同源策略? 同源策略/SOP(Same origin policy)是一种约定,由Netscape公司1995年引入浏览器,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,浏览器很容易受到XSS、CSFR等攻击。所谓同源是指"协议+域名+端口"三者相同,即便两个不同的域名指向同一个ip地址,也非同源。 同源策略限制以下几种行为: 1.) Cookie、LocalStorage 和 IndexDB 无法读取 2.) DOM 和 Js对象无法获得 3.) AJAX 请求不能发送 常见跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.domain