JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery
来源:懂视网
责编:小采
时间:2020-11-27 21:15:55
JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery
JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery:1)在iframe中查找父页面元素的方法:$('#id', window.parent.document) 2)在iframe中调用父页面中定义的方法和变量:parent.methodparent.value 3)实例 1.父页面 代码如下: var hello = 'hello'; function getH
导读JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery:1)在iframe中查找父页面元素的方法:$('#id', window.parent.document) 2)在iframe中调用父页面中定义的方法和变量:parent.methodparent.value 3)实例 1.父页面 代码如下: var hello = 'hello'; function getH

1)在iframe中查找父页面元素的方法:
$('#id', window.parent.document)
2)在iframe中调用父页面中定义的方法和变量:
parent.method
parent.value
3)实例
1.父页面
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="IframeDemo._Default" %>
JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery
JQueryiframe页面操作父页面中的元素与方法(实例讲解)_jquery:1)在iframe中查找父页面元素的方法:$('#id', window.parent.document) 2)在iframe中调用父页面中定义的方法和变量:parent.methodparent.value 3)实例 1.父页面 代码如下: var hello = 'hello'; function getH