how can i call sharepoint webservice using javascript?
Trying to call sharepoint web service using javascript . it's throwing error not able to call sharepoint service . if i call local XML then working fine . I tried below code for calling sharepoint webservice
if (window.XMLHttpRequest开发者_如何学Python)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
alert(xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"));
}
xmlhttp.open("GET","http://#######_n/listdata.svc",true,"#####","#####");
xmlhttp.setRequestHeader( 'Content-Type','application/json');
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
I am passing username and password for Authenticate URL . but not able to get data .
So could you tell me some idea for my problem , how can i access sharepoint webservice . which method is correct for getting all details from .svc . Its very important for me now
Advance thanks :)
Here is a nice walk through: http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx
I'd also recommend that you also take a look at a tool like Fiddler that can watch the traffic between your browser and the server. This can be a great help in figuring out all sorts of problems that might crop up while you are developing.
精彩评论