Javascriptµ÷ÓÃWebserviceµÄ¶àÖÖ·½·¨
ͨ¹ýxmlhttp+webservice(Ôʼ·½·¨)
ÔÎĵØÖ·:http://netboy.cnblogs.com/archive/2006/02/18/333260.html
view plaincopy to clipboardprint?
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[webservice(namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service ()
{
//uncomment the following line if using designed components
//InitializeComponent();
}
[webmethod]
public string SayHelloTo(string Name)
{
return "Hello "+Name;
}
}
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[webservice(namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service ()
{
//uncomment the following line if using designed components
//InitializeComponent();
}
[webmethod]
public string SayHelloTo(string Name)
{
return "Hello "+Name;
}
}
»¹ÊÇË×Á˵㡣:)
2. jsµ÷ÓÃwebservice+xmlhttpµÄʵÏÖ²¿·Ö¡£
view plaincopy to clipboardprint?
<html>
<title>Call webservice with javascript and xmlhttp.</title>
<body>
<mce:script language="javascript"&
Ïà¹ØÎĵµ£º
Ò»¡¢Ö÷Ò³Ãæ(²ÉÓÃjspʵÏÖ)
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@page import="org.accp.jwebplayer.biz.MusicBiz"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<h ......
Ò»¡¢deleteÔËËã·ûɾ³ý¶ÔÒÔǰ¶¨ÒåµÄ¶ÔÏóÊôÐÔ»ò·½·¨µÄÒýÓãº
var o=new Object();
o.name="hello";
alert(o.name); //Êä³ö“hello”
delete o.name£»
alert(o.name); //Êä³ö& ......
ÄÚÖÃÀà
JavaScriptÊÇÒ»ÖÖ»ùÓÚ¶ÔÏóµÄ½âÊÍÐÔ±à³ÌÓïÑÔ£¬ËùÓеÄÔªËØ£¬ÎÒÃǶ¼¿ÉÒÔÀí½âΪ¶ÔÏó£¬Ã¿¸ö¶ÔÏóÒ²¿ÉÒÔÀí½âΪN¶àÊôÐԵļ¯ºÏ¡£ÔÚÌÖÂÛ×Ô¶¨ÒåÀà֮ǰ£¬ÎÒÃÇÏÈ¿´Ò»ÏÂÄÚÖõÄÀà¡£×÷Ϊ½âÊÍÐÔÓïÑÔ£¬JavaScriptÔÊÐíÎÒÃÇÔÚÈκÎʱºòΪ¶ÔÏóÌí¼ÓÊôÐÔ¡£ËùÒÔÎÒÃÇ¿ÉÒÔÏÈ¿´Ò»¶Î¼òµ¥µÄ´´½¨¶ÔÏóµÄ´úÂëÆ¬¶Î¡£ÕâÀïµÄ“new Object”Ò²¿ ......
1.asp.netºô½Ðjs
Response.Write("<script language=javascript>");
&n ......
JavascriptÍøÒ³´òÓ¡´óÈ«
2010-04-09 09:30
ÆÕͨ´òÓ¡£¨ÕûÒ³´ò£© ´òÓ¡ÍøÒ³ÄÚ²¿·ÖÄÚÈÝ£¨×Ô¶¨Ò壩 ´òÓ¡È¥µô/Ìí¼Óҳüҳ½Å ʹÓÃÍⲿ¿Ø¼þ/·½·¨ÊµÏֶ๦ÄÜ´òÓ¡ & ......