(人笨,占时想法的办法,不要骂,不要骂,怕了怕了,想到别的会来改的)

父页面;

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title><!-- keep on record 备案 --></title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<link rel="stylesheet" href="<%=basePath %>base/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="<%=basePath %>base/layuiadmin/style/admin.css" media="all"> </head>
<body>
<div class="layui-fluid"><!-- 布局容器 -->
<div class="layui-row layui-col-space15"> <!-- 列间距 -->
<div class="layui-col-md12"><!-- 列元素 -->
<div class="layui-card"><!-- 卡片面板 -->
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form" action="" lay-filter="keep-on-record"> <div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title">提交资料自检</h2>
<div class="layui-colla-content layui-show">
<iframe name="receiving" lay-filter="receiving" id="receiving" src="projects/Post_certificate/Head.jsp?id=<%=id %>" style="width: 100%; height: 86%;"></iframe>
</div>
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" id="save">保存</button>
<button type="reset" class="layui-btn layui-btn-primary" id='close'>关闭</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div> <script src="<%=basePath %>base/layuiadmin/layui/layui.js"></script>
</body>
<script>
// 当你使用表单时,layui 会对 select、checkbox、radio 等原始元素隐藏,从而进行美化修饰处理。但这需要依赖于 form 组件,所以你必须加载 form,并且执行一个实例
layui.use(['form','laydate','element'], function(){
var $ = layui.$;
var form = layui.form //只有执行了这一步,部分表单元素才会自动修饰成功
,element = layui.element
,laydate = layui.laydate
,layer = layui.layer
,layero = layui.layero; $('#save').click(function(){
console.log("----");
var childWindow = $("#receiving")[0].contentWindow;
//childWindow.bridging();
/* 调用 Head.jsp 下的 bridging (),
此方法是外部方法,还需在 Head.jsp 下编写方法 调用 layui.use() 内的方法 ,
因为 需要获得 Head.jsp 内的表单数据,
也可以在 Head.jsp 外部的方法获得表单 数据*/

  //修改2021.02.24 // 直接调用全局方法
   childWindow.cs();
}); });
</script>
</html>

子页面:

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title><!-- --></title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<link rel="stylesheet" href="<%=basePath %>base/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="<%=basePath %>base/layuiadmin/style/admin.css" media="all"> </head>
<body>
<form class="layui-form" action="" lay-filter="header-information">
<!-- 吧啦吧啦 的 表单内容 -->
</form>
<script src="<%=basePath %>base/layuiadmin/layui/layui.js"></script>
</body>
<script>
// 当你使用表单时,layui 会对 select、checkbox、radio 等原始元素隐藏,从而进行美化修饰处理。但这需要依赖于 form 组件,所以你必须加载 form,并且执行一个实例
layui.use(['form','element'], function(){
var $ = layui.$;
var form = layui.form //只有执行了这一步,部分表单元素才会自动修饰成功
,element = layui.element; window.head2 = function () { // 写一个全局方法
console.log("进入内部");
};

window.cs=function(){
  console.log("进入内部");
}

function head(){
//获取表单区域所有值
var data = form.val("header-information");
console.log(data);
} });
function bridging(){
//console.log("--------------");
head2(); // 调用全局方法
} </script>
</html>

layui 如果调用 from 内嵌入的 iframe子页面方法的更多相关文章

  1. layui type:2 iframe子页面向父页面传值

    需求: 选择子页面表格中的radio或者双击该行,得到的该行数据传到父页面,由父页面渲染. 网上的各种方法都用了,父页面就是获取不到子页面传的值,过了一晚上,睡了一觉,柳暗花明又一村. layui t ...

  2. 父窗口调用iframe子窗口方法

    一.父窗口调用iframe子窗口方法 1.HTML语法:<iframe name="myFrame" src="child.html"></i ...

  3. iframe子页面调用父页面javascript函数的方法

    1.iframe子页面调用 父页面js函数 子页面调用父页面函数只需要写上window.parent就可以了.比如调用a()函数,就写成: window.parent.a(); 2.iframe父页面 ...

  4. js之iframe子页面与父页面通信

    iframe子页面与父页面通信根据iframe中src属性是同域链接还是跨域链接,通信方式也不同. 一.同域下父子页面的通信 父页面parent.html <html> <head& ...

  5. jquery读取iframe子页面和父页面的处理

    1. jquery 在iframe子页面获取父页面元素代码如下: $("#objid", parent.document) 2. jquery在父页面 获取iframe子页面的元素 ...

  6. js 在iframe子页面获取父页面元素,或在父页面 获取iframe子页面的元素的几种方式

    用JS或jquery访问页面内的iframe,兼容IE/FF 注意:框架内的页面是不能跨域的! 假设有两个页面,在相同域下. index.html 文件内含有一个iframe: XML/HTML代码 ...

  7. iframe子页面与父页面元素的访问以及js变量的访问

    1.子页面访问父页面元素  parent.document.getElementById('id')和document相关的方法都可以这样用 2.父页面访问子页面元素  document.getEle ...

  8. JS中iframe子页面与父页面之间通信

    iframe子页面与父页面通信根据iframe中src属性是同域链接还是跨域链接,通信方式也不同. 一.同域下父子页面的通信 父页面parent.html <html> <head& ...

  9. iframe子页面与父页面通信

    同域下父子页面的通信 父页面: <!DOCTYPE html> <html> <head lang="en"> <meta charset ...

随机推荐

  1. Keras函数——mode.fit_generator()

    1 model.fit_generator(self,generator, steps_per_epoch, epochs=1, verbose=1, callbacks=None, validati ...

  2. dbus中的数据类型

    DBus中也是类似于静态语言,使用了"强类型"数据格式.在DBus上传递的所有数据都需要声明其对应的类型,下面整理了下,DBus中的数据类型,以及在DBus中声明的数据类型是什么意 ...

  3. linux 测试2

    .阅读目录●第一种:cat /dev/null > filename●第二种:: > filename●第三种:> filename●第四种:echo "" &g ...

  4. mysql创建用户及赋予某用户权限(附带基础查看表内容)

    首先登陆mysql 一:show databases;  展示所有数据库(root用户下) 二:use xxx (数据库名)使用use选择数据库 三:show xxx   查看数据库中的表 四:des ...

  5. 题解 [HAOI2016]字符合并

    题目传送门 Description 有一个长度为 \(n\) 的 \(01\) 串,你可以每次将相邻的 k 个字符合并,得到一个新的字符并获得一定分数. 得到的新字符和分数由这 k 个字符确定.你需要 ...

  6. bzoj2038 小z的袜子 (莫队)

    题目大意 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿.终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命-- 具体来说,小Z把这N只袜子从1到N编 ...

  7. SudokuSolver 2.0:用C++实现的数独解题程序 【一】

    SudokuSolver 2.0 实现效果 H:\Read\num\Release>sudoku.exe Order please: Sudoku Solver 2.0 2021/10/2 by ...

  8. springcloud整合config组件

    config组件 config组件支持两种配置文件获取方式springcould搭建的微服务的配置文件的获取方式有两种.它支持配置服务放在配置服务的内存中(即本地),也支持放在远程Git仓库中或者本地 ...

  9. OGG-如何只同步最近某个时间范围的数据

    一.需求,某客户希望使用OGG只同步时间大于2021-02-01日期之后的数据变换 需求如标题所示,如何使用OGG进行配置? 客户环境需要同步的表有几百G,表数据太大了;如果同步所有数据,目标库空间存 ...

  10. k8s学习笔记(3)- kubectl高可用部署,扩容,升级,回滚springboot应用

    前言:上一篇通过rancher管理k8s,部署服务应用扩容,高可用,本篇介绍kubectl命令行部署高可用集群节点,测试升级.扩容等 1.测试环境:3节点k3s,使用其中2节点(ubuntunode1 ...