标签:element client value end ems var web create int
<script type="text/javascript">
function getlistitem()
{
var mycontext=new SP.ClientContext();
var mysite=mycontext.get_web();
var query = new SP.CamlQuery();
query.set_viewXml("<View><Query></Query></View>");
var mylist=mysite.get_lists().getByTitle(‘test‘);
myitem= mylist.getItems(query);
mycontext.load(myitem);
mycontext.executeQueryAsync(Function.createDelegate(this,this.getsuccessed),Function.createDelegate
(this,this.getfailed));
}
function getsuccessed()
{
var str="";
var gh="";
var listsE=myitem.getEnumerator();
while(listsE.moveNext())
{
gh+=listsE.get_current().get_item("_x5de5__x53f7_")+"<br>";
str+=listsE.get_current().get_item("Title")+"<br>";
}
document.getElementById("lists").innerHTML=gh;
}
function getfailed(sender,args)
{
alert("failed~!");
}
</script>
<div><input value="get2" type="button" onclick="getlistitem()"/></div>
<div id="lists"></div>
<div id="listg"></div>
标签:element client value end ems var web create int
原文地址:http://www.cnblogs.com/914556495wxkj/p/6890715.html