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.get_headers()["Accept"] = "application/json";

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.

1 Answer 1


just in case anyone else runs into this I figured out what was going on:

I usually create multiple custom aspx pages in SP2010 and never really ran into this issue before. When I do, I always add the scriptlink back in:

<SharePoint:ScriptLink name="SP.js" defer="true" runat="server" Localizable="false"/>

but it appears that you must also include a generic form tag for security reasons. when you create a blank aspx page its already there, guess I just happened to accidentally remove it on this page. After I wrapped everything in a simple generic form tag it all worked again (REST & SP JSOM):

<form id='form1' runat='server'>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.