iframe

iframe 调用父页面元素

不打扰是莪最后的温柔 提交于 2020-01-08 19:20:06
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IFrame.aspx.cs" Inherits="IframeDemo.IFrame" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <script language="javascript" type="text/javascript" src="jquery-1.5.1.min.js"></script> <script language="javascript" type="text/javascript"> $(function() { //在iframe中查找父页面元素 alert($('#default', window.parent.document).html()); //在iframe中调用父页面中定义的方法 parent.getHelloWorld(); /

Are IFrames (HTML) obsolete? [closed]

冷暖自知 提交于 2020-01-08 16:01:22
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Getting contradictory messages about that, hope they're not. I cannot imagine support for it would stop, since a gazillion sites use

SVG 画图

陌路散爱 提交于 2020-01-08 11:01:02
SVG 在线画图工具: https://svg.haowen100.com/ 把画的图片代码保存成svg文件,加载 http://www.bejson.com/convert/image_to_svg/ https://www.aconvert.com/cn/image/png-to-svg/ 参考一 SVG 是一种基于 XML 语法的图像格式,全称是可缩放矢量图(Scalable Vector Graphics)。其他图像格式都是基于像素处理的,SVG 则是属于对图像的形状描述,所以它本质上是文本文件,体积较小,且不管放大多少倍都不会失真。 SVG 文件可以直接插入网页,成为 DOM 的一部分,然后用 JavaScript 和 CSS 进行操作。 <!DOCTYPE html> < html > < head > </ head > < body > < svg id = "mysvg" xmlns = " http://www.w3.org/2000/svg " viewBox = "0 0 800 600" preserveAspectRatio = "xMidYMid meet" > < circle id = "mycircle" cx = "400" cy = "300" r = "50" /> < svg > </ body > </ html > 上面是 SVG

修改iframe里的内容

允我心安 提交于 2020-01-08 10:53:12
let win =document.getElementsByTagName('iframe')[0].contentWindow; let doc = win.document; let html = doc.getElementsByTagName('html')[0]; ht.innerHTML = `你设置的内容` 来源: CSDN 作者: 没有神笔的马良 链接: https://blog.csdn.net/Lambert0320/article/details/103886183

关于窗口跳转的一些总结

血红的双手。 提交于 2020-01-08 03:36:41
  在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口。 1、window.self   功能: 是对当前窗口自身的引用。它和window属性是等价的。   语法: window.self   注: window、self、window.self是等价的 2、window.top    功能: 返回顶层窗口,即浏览器窗口。    语法: window.top    注: 如果窗口本身就是顶层窗口,top属性返回的是对自身的引用 3、window.parent    功能: 返回父窗口    语法: window.parent    注: 如果窗口本身就是顶层窗口,parent属性返回的是对自身的引用   在框架网页中,一般父窗口就是顶层窗口,但如果框架中还有框架,父窗口和顶层窗口就不一定相同了。    总结: 你应该当将框架视为窗口中的不同区域,框架是浏览器窗口中特定的部分。一个浏览器窗口可以根据你的需要分成任意多的框架,一个单个的框架也可以分成其它多个框架,即所谓的嵌套框架。    注:parent与opener的区别:   parent指父窗口,在frameset中

20150311—html中iframe(转发)

非 Y 不嫁゛ 提交于 2020-01-08 00:49:03
JS实现iframe框架页面跳转和刷新 一、js方式的页面跳转 1.window.location.href方式 <script language="javascript" type="text/javascript"> window.location.href="index.html"; </script> 2.window.navigate方式跳转 Firefox不支持 <script language="javascript"> window.navigate("top.jsp"); </script> 如果:top.jsp中有Iframe则,top.jsp在iframe中打开。(IE6测试过); 3.window.loction.replace方式实现页面跳转,注意跟第一种方式的区别 <script language="javascript"> window.location.replace("http://www.siteeasy.cn"); </script> 有3个jsp页面(a.jsp, b.jsp, c.jsp),进系统默认的是a.jsp ,当我进入b.jsp的时候, c.jsp里面用window.location.replace("c.jsp");与用window.location.href ("c.jsp");从用户界面来看是没有什么区别的,但是当c

js中跨域问题

旧时模样 提交于 2020-01-07 13:07:54
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、什么叫做js跨域 javascript为了安全着想,在ajax以及iframe中不允许跨域调用。 二、哪些情况算作跨域 1.协议名称不同 从http://www.test.com中调用https://www.test.com 2.端口不同 从http://www.test.com调用http://www.test.com:9999 3.域名不同 从http://www.test.com调用http://login.test.com 从http://www.test.com调用http://www.test2.com 三、如何解决js跨域 1.使用jsonp 在js中,我们直接用 XMLHttpRequest 请求不同域上的数据时,是不可以的。但是,在页面上引入不同域上的js脚本文件却是可以的,jsonp正是利用这个特性来实现的。 例如: <script type="text/javascript"> function dosomething(jsondata){ //处理获得的json数据 } </script> <script src="http://example.com/data.php?callback=dosomething"></script> jsonp就是回调函数+数据。callback({

Load external html in Iframe and access the contents

二次信任 提交于 2020-01-07 06:56:48
问题 I need to know how to access the iframe contents when we are loading an external page with only giving src attribute. I am using an iframe to load an HTML page inside a jquery dialog box. Here I am not able to modify the contents (pre-populate the contents of HTML form) var page = "form.html"; var $dialog = $('<div id="myDialog"></div>') .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>') I have looked here but it doesn't work as it does not know

Load external html in Iframe and access the contents

依然范特西╮ 提交于 2020-01-07 06:56:05
问题 I need to know how to access the iframe contents when we are loading an external page with only giving src attribute. I am using an iframe to load an HTML page inside a jquery dialog box. Here I am not able to modify the contents (pre-populate the contents of HTML form) var page = "form.html"; var $dialog = $('<div id="myDialog"></div>') .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>') I have looked here but it doesn't work as it does not know

convert preload img to iframe

南笙酒味 提交于 2020-01-07 06:36:12
问题 $('<img />') .attr('src', val) .attr('width', "400") .load(function(){ $('.showdata').append( $(this) ); } ); This works perfectly for images, how would this convert 1:1 to iframes? Here quick jsfiddle: http://jsfiddle.net/ET8Gw/ 回答1: Unlike Image objects, IFrames will not load until they are part of the DOM. To get around this you can hide the element, add it to the DOM, and when the load event fires show it: var val = "http://dumb.com/"; $('<iframe />') .hide() .attr('src', val) .attr(