SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 0 down vote accepted

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'>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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