溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

showModalDialog的使用

發(fā)布時間:2020-07-09 14:44:19 來源:網(wǎng)絡(luò) 閱讀:639 作者:houqida 欄目:web開發(fā)

showModalDialog的合理使用會加速你程序的開發(fā),下面我把我的代碼貼出來分享

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@	taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.01 Transitional//EN">
<html>
<head>

<%@ include file="noCache.jsp"%>
<link rel="stylesheet" type="text/css" href="css/content.css">
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/jquery.datepick.js"></script>
<script type="text/javascript" src="js/jquery.datepick-zh-CN.js"></script>
<link href="css/jquery.datepick.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#ck").click(
						function() {
							$("[name='pageForm']").attr("action",
									"CustomerAction_toaddBzwzchuku");
							$("[name='pageForm']").submit();
						});
			});
	// 時間選擇器
	$(document).ready(function() {
		
		$("#dateinput2").datepick({
			dateFormat : 'yy-mm-dd'
		});
		$("#dateinput1").datepick({
			dateFormat : 'yy-mm-dd'
		});
	});
</script>
</head>
<body>
	<div id="biaoti" class="tbtitle01">
		<b>前臺登記修改審計查詢</b>
	</div>
	<div class="space_h_10"></div>
	<s:form action="SampleAction_selectSampleshenji" name="pageForm" method="post">
		起始時間:<s:textfield name="sj.time1" id="dateinput1"></s:textfield>
		終止時間:<s:textfield name="sj.time2" id="dateinput2"></s:textfield>
		<s:submit value="查詢"></s:submit>
	<table width="100%" border="0" cellpadding="6" cellspacing="0"
		class="tb_list1">
		<tr>
			<th>序號</th>
			<th>樣品號</th>
			<th>報告號</th>
			<th>修改人</th>
			<th>修改時間</th>
<!-- 			<th>修改內(nèi)容</th> -->
			<th>查看詳細(xì)</th>
			
		</tr>
		<s:iterator value="#request.sampleshenjilist" status="st">
			<tr>
				<td ><s:property value="#st.index+1" /><input type="hidden" name="" value="${id }"/></td>
				<td><s:property value="sample_number" /></td>
				<td><s:property value="text_id" /></td>
				<td><s:property value="name" /></td>
				<td><s:property value="time" /></td>
<!-- 				<td><s:property value="content" /></td> -->
				<td ><a href="#" onclick="queryDetail('<s:property value="id" />')">查看詳細(xì)</a></td>
				
			</tr>
		</s:iterator>
	</table>
<!-- 	<input type="button" value="出庫" id="ck"/> -->
	${page }
	</s:form>
	<script type="text/javascript">
		function queryDetail(value){
			var url = "SampleAction_selectShenjiXiangxi?id="+value;
			window.showModalDialog(url,"view","dialogWidth=550px;dialogHeight=600px");
		}
	</script>
</body>

</html>

基本介紹:
          showModalDialog()         (IE 4+ 支持)
          showModelessDialog()      (IE 5+ 支持)
          window.showModalDialog()                  方法用來創(chuàng)建一個顯示HTML內(nèi)容的模態(tài)對話框。
          window.showModelessDialog()             方法用來創(chuàng)建一個顯示HTML內(nèi)容的非模態(tài)對話框。
使用方法:
          vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
          vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
參數(shù)說明:
         sURL          --  必選參數(shù),類型:字符串。用來指定對話框要顯示的文檔的URL。
         vArguments    -- 可選參數(shù),類型:變體。用來向?qū)υ捒騻鬟f參數(shù)。傳遞的參數(shù)類型不限,包括數(shù)組等。對話框通過
 

                          window.dialogArguments來取得傳遞進(jìn)來的參數(shù)。
         sFeatures     -- 可選參數(shù),類型:字符串。用來描述對話框的外觀等信息,可以使用以下的一個或幾個,用分號“;”隔開。
----------------
1.    dialogHeight:    對話框高度,不小于100px
2.    dialogWidth:    對話框?qū)挾取?br />3.    dialogLeft:     離屏幕左的距離。
4.    dialogTop:     離屏幕上的距離。
5.    center:          { yes | no | 1 | 0 } :              是否居中,默認(rèn)yes,但仍可以指定高度和寬度。
6.    help:             {yes | no | 1 | 0 }:                是否顯示幫助按鈕,默認(rèn)yes。
7.    resizable:       {yes | no | 1 | 0 } [IE5+]:     是否可被改變大小。默認(rèn)no。
8.    status:          {yes | no | 1 | 0 } [IE5+]:      是否顯示狀態(tài)欄。默認(rèn)為yes[ Modeless]或no[Modal]。
9.    scroll:            { yes | no | 1 | 0 | on | off }:是否顯示滾動條。默認(rèn)為yes。


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI