Skip to main content
updated answer based on feedback
Source Link
Nadeem Yousuf
  • 18.7k
  • 4
  • 30
  • 59

Use single quotes instead of double quotes while using Include. That is, change this line context.load(items, "Include(Title)"); to context.load(items, 'Include(Title)');

UPDATE

As mentioned by @Per, set_viewXml is a method and you are using it as property. Try this:

query.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'Title\'/>' + '<Value Type=\'Text\'>Acer</Value></Eq></Where></Query></View>'); 

Use single quotes instead of double quotes while using Include. That is, change this line context.load(items, "Include(Title)"); to context.load(items, 'Include(Title)');

Use single quotes instead of double quotes while using Include. That is, change this line context.load(items, "Include(Title)"); to context.load(items, 'Include(Title)');

UPDATE

As mentioned by @Per, set_viewXml is a method and you are using it as property. Try this:

query.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'Title\'/>' + '<Value Type=\'Text\'>Acer</Value></Eq></Where></Query></View>'); 
Source Link
Nadeem Yousuf
  • 18.7k
  • 4
  • 30
  • 59

Use single quotes instead of double quotes while using Include. That is, change this line context.load(items, "Include(Title)"); to context.load(items, 'Include(Title)');