1 页面登陆的基本要素
你可以在我的竹叶看到登陆 的表单,这里提供了最基本的登陆表单项
(1)登陆表单
<form method=post name=chatform action=chat/login.php?action=enter onsubmit="b1_submit();return true;" target="howtodo">
(a)聊天表单的名字为chatform,我使用action=enter作为进入聊天室的入口,如果没有这个参数,则显示登陆页 面.
(b)在表单提交时,先调用b1_submit()建立聊天的窗口
(c)聊天的目标窗口为b1_submit()建立 的howtodo窗口
(2)表单项
昵称:<input type=text name=name size=15 maxlength="10">
密码:<input type=password name=pass size=15 maxlength="10">
<input type=submit name=submit value=登陆 style="width:100">
<input type=reset name=reset value=重添 style="width:50">
(a)各表单项一定要设定最大允许长度 maxlength
(3)建立聊天窗口的js
<script language="javascript">
function b1_submit(){
chat=window.open('',"howtodo",'status=no,scrollbars=no,resizable=no');
chat.moveto(0,0);
chat.resizeto(screen.availwidth,screen.availheight);
chat.outerwidth=screen.availwidth;
chat.outerheight=screen.availheight;
}
这段代码先 打开一个没有状态栏,滚动条,可调整尺寸的howtodo窗口!然后移动到屏幕左上角,然后放大到允许的屏幕大小.
聊天室编程思想--大门 -- 通行证
大门 -- 通行证
聊天室可以采用完全自由的方式运行,你可以随意 输入呢称,不用密码,
| 对此文章发表了评论 |
