html父子页面(弹框)的实现和交互[通信]

    html页面,有的时候不是直接一个页面,一连串(或并行)页面的结束,为了提高用户体验或完成某种功能需要父子页面(或窗口)来实现,或者父子,兄弟窗口来完成。本文主要介绍:

    html父子页面(弹框)的实现和交互[通信]

    实现简单业务介绍:

    1.父页面,点下“注册”按钮,按钮锁定,并弹框;

     2.父页面隐藏域的值“欢迎您的注册……”,传给子弹框,并显示;

     3.子窗口,进行注册用户,成功后调用父页面js方法,将注册的“用户名”填写到登录用户名中;

     4.用户登录,后台ajax传值,显示注册的“用户名”;

     5.后台类的处理,使用MAP保存[内存暂时],然后用用户名去获取对象进行登录验证。

 

父页面jsp代码[popupmain.jsp]:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
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">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="${pageContext.request.contextPath }/tsjs/jquery-1.11.1.js"></script>	
	<script type="text/javascript" src="${pageContext.request.contextPath }/tsjs/popupmain.js"></script>	

  </head>
  
  <body>
  <center id="centerid">
  	<div id="userlogin">
  		<form id="userloginform">
  		<table id="tbuserlogin" width="150" border="0" cellpadding="0" cellspacing="0">
  			<tr class="setshow">
  				<td width="30">user:</td>
  				<td width="70">
  					<input id="userlog" name="userlog" type="text" maxlength="8" size="15" />
  				</td>
  				<td width="50"><div id="userlogmsg"></div></td>
  			</tr>
  			<tr class="setshow">
  				<td width="30">pass:</td>
  				<td width="70">
  					<input id="passlog" name="passlog" type="password" maxlength="12" size="15" />
  				</td>
  				<td></td>
  				<td></td>
  			</tr>
  			<tr>
  				<td colspan="2" align="right">
  				<div id="userregbtdiv">
  					<input type="button" id="popupbt" value="注册" />
  				</div>
  				<div id="userloginbtdiv">
  					<input type="button" id="userlogin" value="登录" οnc
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值