I am running into something that I haven't really seen before, and I have been using this approach quite a bit lately for a variety of pages. SharePoint 2010 javascript using REST API to grab data:
getContent("http://myServer/sites/mySite/_vti_bin/ListData.svc/Announcements", thisCallback)
function getContent(whatURL, callback)
{
var request = new Sys.Net.WebRequest();
request.set_httpVerb("GET");
request.set_url(whatURL);
request.get_headers()["Accept"] = "application/json";
request.add_completed(callback);
request.invoke();
}
and parse json and process with callback. but now i am getting console error "Sys is undefined" and I am using the same approach within the same site on different pages and it works? any ideas? just for checking i would add a simple callback and it still doesn't work
function thisCallback(response, eventArgs)
{
// wish i could get some results to work with
}
appreciated as always.