js有没无模式对话框概念?我想实现如下....

CDcolor 2004-05-11 03:04:21
一个页面,弹出对话框.
我需要实现:用户根据页面的信息操作对话框,将一些信息加入数据库.dialogbox无刷新.
'--------------------------
|combox001| |combox002|


|Ok|


js初学,描述不清.
能给个代码吗?
...全文
57 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
CDcolor 2004-05-11
  • 打赏
  • 举报
回复
加载xml文件错误,请跟斑竹联系!!请斑竹生成以下论坛的贴子列表!!
roomid:304
typenum:2
CDcolor 2004-05-11
  • 打赏
  • 举报
回复
问题解决!这么多星星来回复,感谢感谢!
wanghr100 2004-05-11
  • 打赏
  • 举报
回复
无刷新可以用XMLHTTP实现.

demo.htm

<input type="button" onclick="window.showModalDialog('in.htm')" value="Open">

in.htm

webname:<input type=text name=webname><br>
weburl:<input type=text name=weburl><br>
<input type=button onclick="bao(document.all.webname.value,document.all.weburl.value)" value="add">
<script>
function bao(sname,surl)
{
var oBao = new ActiveXObject("Microsoft.XMLHTTP");
oBao.open("POST","test.asp?webname="+sname+"&weburl="+surl,false);
oBao.send();
alert("Add ok");
document.all.webname.value="";
document.all.weburl.value="";
}
</script>


test.asp

<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.MapPath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.CreateObject("ADODB.CONNECTION")
conn.open connstr
%>
<%
webname = Request.QueryString("webname")
weburl = Request.QueryString("weburl")
conn.Execute("Insert into web(webname,weburl)VALUES('"&webname&"','"&weburl&"')")
rs.close
set rs = nothing
conn.close
set conn = nothing
%>

数据库 data.mdb
表web
字段id,webname,weburl
gjd111686 2004-05-11
  • 打赏
  • 举报
回复
操作returnValue
gjd111686 2004-05-11
  • 打赏
  • 举报
回复
showModalDialog

--------------------------------------------------------------------------------

Description

Creates a dialog box and displays in it the HTML document given by URL. The dialog box is a special window that is modal, meaning it retains the input focus until the user closes it.

Syntax
variant = object.showModalDialog(sURL [, vArguments [, sFeatures]])



Parameter Description
sURL String specifying the URL of the document to load and display. While an empty string is accepted (""), it should be noted that this is useless since once a modal dialog has been opened, it cannot be accessed by the page that opened it.
vArguments Optional. Variant specifying the arguments to use when displaying the document. This parameter can be used to pass a value of any type including an array of values. The dialog can extract the values passed by the caller from the dialogArguments property of the window object.
sFeatures Optional. String specifying the window ornaments for the dialog box. It can be a combination of the following values. Syntax Description
dialogWidth:number Sets the width of the dialog window.
dialogHeight:number Sets the height of the dialog window.
dialogTop:number Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogLeft:number Sets the left position of the dialog window relative to the upper-left corner of the desktop.
center:{yes | no | 1 | 0 } Specifies whether to center the dialog window within the desktop. Default is yes.


Return Value

Returns a number, string, or other value. This is equal to the value of the returnValue property as set by the document given by URL.
孟子E章 2004-05-11
  • 打赏
  • 举报
回复
http://www.csdn.net/Develop/read_article.asp?id=15113
CDcolor 2004-05-11
  • 打赏
  • 举报
回复
up,怎么看不到帖子?

87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧