Javascriptµ÷ÓÃWebService
WebServiceÎļþ£º
[WebMethod]
public int DoMulti(int num1,int num2)
{
int result;
result = num1 * num2;
return result;
}
ASPXÎļþ£º
<%@ Page language="c#" Codebehind="Javascript.aspx.cs" AutoEventWireup="false" Inherits="WebTest.Javascript" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Javascript</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<mce:script language="javascript"><!--
function doMul(){
service.useService("http://localhost/WebServiceTest/Multi.asmx?wsdl","DoMultiService");
var parm1 = Form1.all.mul1.value;
var parm2 = Form1.all.mul2.value;
service.DoMultiService.callService(callback,"DoMulti",parm1,parm2);
}
function callback(res){
if (!res.error)
Form1.all.retValue.value=res.value;
else
Form1.all.retValue.value='ERR';
}
// --></mce:script>
</HEAD>
<body>
<div id="service" style="BEHAVIOR:url(webservice.htc)" mce_style="BEHAVIOR:url(webservice.htc)"></div>
<form id="Form1" method="post" runat="server"><FONT
face=ËÎÌå><INPUT type=text id=mul1 name=mul1>*<INPUT type=text id=mul2 name=mul2><INPUT style="WIDTH: 50px" onclick=doMul() type=button value="="><INPUT
type=text id=retValue name=retValue></FONT>
</form>
</body>
</HTML>
ÆäÖÐ webservice.htc ÐèÒªÁíÍâÏÂÔØ
http://msdn.microsoft.com/workshop/author/webservice/webservice.htc
Ïà¹ØÎĵµ£º
C#:
´´½¨£º
¡¡¡¡¡¡¡¡HttpCookie cookie = new HttpCookie("regID");
cookie .Value = username;
cookie .Expires = DateTime.Now.AddDays(1);
& ......
14 ·Ö¸î×Ö·û´®
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “a,b,c,d”;
4: var stringArray = myVariable.split(“,”);
5: document.write(stringArray[0]);
6: document.write(stringArra ......
ʹÓÃJavaScript ¶ÔCookie ²Ù×÷µÄ·â×°
ͨ¹ý±¾Æª,ÄúÄÜÁ˽⵽:
ÄäÃûº¯Êý
±Õ°üµÄ²úÉú
JavaScriptʵÏÖprivate ÒÔ¼° public ·ÃÎÊȨÏÞ
document.cookie µÄ²Ù×÷
Javascript ûÓÐ private , public ·ÃÎÊȨÏÞÉèÖõĹؼü×Ö,µ«ÊÇ¿ÉÒÔͨ¹ýÒ»¶¨µÄ¼¼ÇÉÀ´Ä£Äâ³öÏàͬµÄ½á¹û.
Ê×ÏÈÎÒÃÇÀ´¿´ÏÂÃæÒ»ÐÐ ......
Æäʵ¾ÍÊÇÓÃmeÀ´´úÌæthis£¬²»¶à˵£¬¿´´úÂ룺
=============================
´úÂë1£º
<html>
<head>
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<body>
<input id="testit" type=button value="²âÊÔ" onclick="vbscript:me.value='Íê³É'">
<input id="testit" type=button v ......
ShowModalDialogº¯ÊýµÄ¹¦ÄÜ£º
´ò¿ªÒ»¸ö×Ó´°¿Ú£¬²¢ÇÒ¿ÉÓ븸´°¿ÚÏ໥´«µÝÊý¾Ý£¬ËüÓëwindow.openµÄ×î´óÇø±ð¾ÍÔÚÓÚÓÉShowModalDialog´ò¿ª×Ó´°¿Úºó£¬¸¸´°¿Ú½«²»ÄܲÙ×÷¡£
ʹÓ÷½·¨£º
vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
²ÎÊý˵Ã÷£º
sURL
±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´®¡£ÓÃÀ´Ö¸¶¨¶Ô»°¿òÒªÏ ......