在站点'的“中文题库”列表中新加一条,其“Title”字段为“test”
关键字: JavaScript Sharepoint list Web Servive SOAP XMLHttpRequest
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Test Page</title> <meta name="Microsoft Theme" content="Verdant 1011, default">
<script type="text/javascript"> function SaveListItem() { var soapRequest = '' + '' + ''+ ''+ '中文题库'+ ''+ ''+ ''+ 'test'+ ''+ ''+ ''+ ''+ ''+ '';
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlHttp.open('post', '_vti_bin/Lists.asmx', false,null,null); xmlHttp.setRequestHeader('Content-Type','application/soap+xml; charset=utf-8');
xmlHttp.send(soapRequest); }
function createXmlHttpRequest(){ if(window.ActiveXObject){ //for IE return new ActiveXObject("Microsoft.XMLHTTP"); }else if(window.XMLHttpRequest){ //Non-IE Browser return new XMLHttpRequest(); } } </script>
</head> <body> <input type="button" onclick="SaveListItem()" value="Go"> </body> </html>
|
阅读(711) | 评论(0) | 转发(0) |