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"&
相关文档:
刚在CSDN上看到一篇JAVASCRIPT的面试题目,其中有一个题目是关于javascript关键字的问题,试做了一下,结果做错了。唉。汗一个
于是上网找了一下,在此记录下来,以自勉。
Javascript关键字(Reserved
Words)是指在Javascript语言中有特定含义,成为Javascript语法中一部分的那些字。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 ......
JavaScript中的模块和名字空间是不可区分的内容。
我们定义的每个单独的函数都是作为全局对象的一个属性。而JavaScript代码模块所必须遵循的最重要的规则就是:避免定义全局变量。因为,当定义一个全局变量时,都要被其他模块覆盖的危险,所以模块化编码要用如下方式:
var ModuleClass={};
ModuleClass.函数名1=functio ......
完全打开页面后,在该页的在IE地址栏 或 按Ctrl+O 输入以下代码,回车,就可以得到相应的效果:
1.显示网页中的所有图片
javascript:Ai7Mg6P='';for%20(i7M1bQz=0;i7M1bQz<document.images.length;i7M1bQz++){Ai7Mg6P+='<img%20src='+document.images[i7M1bQz].src+'><br>'};if(Ai7Mg6P!=''){document.wri ......