Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ���ܵ�Сʨ
Thu, 07 May 1998 00:00
����JavaScript����WebӦ��
Author: ���ܵ�Сʨ
Date: Thu, 07 May 1998 00:00
Date: Thu, 07 May 1998 00:00
107 lines
7464 bytes
7464 bytes
WWW(World Wide Web)��ȫ��Χ�ڿɹ�����ʵ���Ϣ�ռ䡣����We
b�����ķ�չ,ʹ��Ҫ������,��ͳ�ľ�̬Webҳ�������㲻���û���
������Webվ��ʱӦ���ؿ��Ƕ�̬������ʽWebҳ�桢Web�����
�⼯�ɵ����⡣Web��̬ҳ�������,��ͳ��������CGI���,��a va��
JavaScript��Ŀǰ���еķ���;Web��Ϣ����ݿ�Ĺ���,�ɲ���Java
��JavaScript��SA PI��ISAPI�ȷ�����ʵ�֡�
���Ľ����������JavaScript�������������
JavaScript���
JavaScript��Netscape��˾�Ƴ���һ�ֿ�ƽ̨�����ڶ���Ľű�
���ԡ���������ڿͻ���Ӧ��,�ֿ����ڷ�������Ӧ�ÿ�����
1���ͻ���JavaScript
���ͻ���,��Navigator,ͨ�������������������ҳ��ʱ,����HT
ML�ĵ���JavaScript���,Navigator����Ƕ����HTML�е�JavaScript
���,Ȼ����ʾHTMLҳ��,��ִ��JavaScript��䡣�ͻ���Ƕ��HTMLҳ
���JavaScript�����Ӧ�û����¼��������κ����紫��,Ƕ��JavS
cript��HTMLҳ���ܹ������������,����ͨ��Ի������û�������
2����������JavaScript
Nestcape��˾��LiveWire��һӦ�ÿ�������,�����ڷ�������Jav
aScript������LiveWr eJavaScriptӦ�ñ�����ɿ�ִ���ļ��ֽ���,
��Щ��ִ�е�Ӧ������LiveWire�ķ���������ʱִ�С�LiveWire�Ƿ�
������չ,�ɶ�̬���HTMLҳ�档������Ȼ��ͨ�����罫��һHTMҳ��
(�����ͻ���JavaScript)��䷢�����������ʾ�����ͼ1��ʾ
��ͼ1
���CGI�������,LiveWire JavaScriptֱ����HTMLҳ�漯��,
�������㡢���,��������ά����LiveWire��һ������,�û�ʹ��
����Դ������ͻ��Ͷ��Ӧ��,�����ṩ��ݿ���ʵĶ���ͷ���,
ʹ֮��Ϊ��SQL��ݿ�������Ľӿڡ�
�ͻ���Ӧ�ÿ���
�ͻ���Ӧ��ָ����JavaScript����ڿͻ������������ִ�С���
��JavaScript������ǿHTML,��Webҳ���ϼ��붯̬������Ϣ�����п�
����Ӧ�ÿ���,����Ҫ�˽���������ö������ι�ϵ,��ͼ2��ʾ
��
ͼ2
JavaScript����Ƕ��HTML�ļ��е��κεط�,�ñ����������
ʹ��JavaScript���?̬HTMLҳ��ֻ������Document����,��̬��
������ͨ�����ö����������¶����̡�������ͨ��Webҳ���ύ��
��Ϊ��,����JavaScript��Ӧ�á���������Navigator������Form����
��̴��?����һ����ݻ��Ը��û�,������ʵ��:
function initArray(n){this.length=n;
for(var i=1;i<=this.length;i++)this[i]=0;
return this;}function send(FormObject){msg=open("","Disp
laywindows","toolbr =yes,directories=no,menubar=yes,scrollba
rs=yes,status=yes,location=yes");
msg.document.write("<head><TITLE>Your address</TITLE></h
ead>");
msg.document.write("<body>");
var yourAddress=new init Array(6);
your Addreess[1]="Name";
yourAddress[2]="Email";
your Address[3]="Tel";
your Address[4]="FAX";
yourAddress[5]="Address";
yourAddress[6]="Post";
msg.document.write("<center><h2>Your Address</h2></cente
r><br><p>");
msg.document.write("<address><font size=+2>");
for(var i=1;i<=7;i++)msg.document.write(your Address[i]+
":"+FormObject.elee nts[i-1].value);
msg.document.write("</address></font><p><br>");
msg.document.write("Return to<A HREF=��Your URL/��>homep
age</A>");
msg.document.write("<p><br></body>");
������Ӧ�ÿ���
Netscape��Enterprise Server֧�ַ�������JavaScript������
����JavaScript���ڷ������˽���ִ��;��ͻ������,��<Server>��
</Server>�����������JavaScript���Ŀ�ʼ�ͽ����������Jav
aScriptӦ�ÿ��������ô����������˵Ķ���,����File��Blob��Dt e
��Connection��Cursor�ȡ���Enterprsie Server 3.0���ּ�������
�Ķ���,��SendMail��Lock��DbPool��Stproc��Resultset�ȡ�������
��������ʹ��SendMail����:
mailObj=new SendMail();
mailObj.To="smith@sei.xidian.edu.cn";
mailObj.From="Server@sei.xidian.edu.cn";
mailObj.Subject="Say Hello";
mailObj.Body="Hello World!";
mailObj.send();
if(mailObj.errorcode()!=0){erroMsg=mailObj.errorMessage(
);}�������Կͻ�ͨ��Webҳ�����Form����ύΪ��,˵���ڷ�����
�����ʹ��JavaScript����Form���������Ϣ��Ϊһ����¼��ӵ���
�ݿ��С�
<html><head><title>Alumni Add</title></head><body><serve
r>var error=0;
var alumni=database.cursor("select * from Alumni",true);
alumni.aluName=request.Name;
alumni.aluEmail=request.Email;
alumni.aluPhone=request.Phone;
alumni.aluFax=request.Fax;
alumni.aluAddress=request.Address;
alumni.aluPostcode=parseInt(request.Postcode);
error=alumni.insertRow("alumni");
write("<p>New Alumni succefully added");
</server><p><a href="homepage.html">Return to Homepage</
a></body></html>�����ύ��ť,�ó�������ݿ���������Ϣ,������
������������ѳɹ�����Ĵ���Ϣ,�û����ɴ˷�����ҳ��
--
________ _____ _____ ______________ _____
___ __ \___(_)________ ___(_) __ ___/___ /_ ___(_)
__ /_/ /__ / ___ __ \__ / _____ \ __ __ \__ /
_ ____/ _ / __ /_/ /_ / ____/ / _ / / /_ /
/_/ /_/ _ .___/ /_/ /____/ /_/ /_/ /_/
/_/
[m[1;36m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads