<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";
soapEnv += "<listName>{5DE9D1F4-9860-4B44-B835-2A62254880E4}</listName>";
soapEnv += "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'></Value></Eq></Where></Query>";
soapEnv += "<ViewFields><ViewFields><FieldRef Name='标题'/><FieldRef Name='Body'/></ViewFields></ViewFields><RowLimit>10</RowLimit>";
soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>";
$("#btn1").click(function() {
$.ajax({
type: "POST",
contentType: "text/xml; charset=\"utf-8\"",
url: "http://pcwin200-5a17a1:28371/tet/_vti_bin/Lists.asmx/GetListItems",
data: soapEnv,
dataType: "xml",
success: function(result) {
//$(document).html(result);
alert("wancheng");
},
Error:function(result)
{
alert("chuxiancuowu");
},
Complete:function(result)
{
alert("jieshu");
}
});
});
});
</script>
</head>
<body>
<input type="button" id="btn1" value="提交"/>
</body>
</html>
你好,我做shrepoint的二次开发,决定用ajax实现访问sharepoint的webservices,代码写完了,但是程序没有任何反应,我觉得很奇怪,不管对或错,应该有所提示啊,所以请各位帮我看看,是何原因导致的,谢谢。
http://www.cnblogs.com/regedit/archive/2008/03/04/1089948.html
http://www.cnblogs.com/ziyan22/archive/2010/10/30/1865187.html
ajax的话楼主用firebug之类的调试工具来查看返回信息吧
如果没有根据异常做相应的响应处理会报500错误而且不会反应到界面上来...