REST API and SP List

I've been looking at this for a few hours and can't figure out what the problem is.  I'm using REST to retrieve data from a list and then display it on a page but the page is always blank.  Any ideas?

<script type="text/javascript" src="" language="javascript"></script>

<script language="text/javascript">
//wait until page has been loaded completely

$(document).ready(function() {
//use the getJSON mehtod of Jquery
$.getJSON("",function(data) {
//prepare HTML to render output to DIV resultarea
            var html = "";
            html = html+"<table border='2'>";
//iterate through all returned list items
$.each(data.d.results, function(i,result) {

//get item property

var strTitle = result.Title;
//add property to HTML      

				html += "<tbody><tr><td align='center'><h3>Title</h3></td></tr><tr><td width='*'>"+strTitle+"</td></tr></tbody>"; 
//finally close table and render HTML to DIV resultarea
            html += "</table>";



<div id="resultarea" width="250px" height="300px"></div>

Open in new window
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
Always eliminate the obvious

<script language="text/javascript">

Change language to type

Also this returns a 404
IsaacSharePoint Client Side DeveloperAuthor Commented:
I actually don't need that file and took that out and still nothing rendered....
IsaacSharePoint Client Side DeveloperAuthor Commented:
Good Catch!  Thanks!
Robin HallSenior Web Solutions ArchitectCommented:

I tend to use Form Web Parts if I'm putting code on a page as content editor web parts can sometimes cause problems.

I think your main issue would be what Gary pointed out.  The Rest Service returning an error.  I used the most basic service on my sharepoint server, http://server/_vti_bin/listdata.svc, and I was able to succesfully get back a full list of my Lists.  Trying it on your website,, resulted in a generic "An error has occurred on the server" message.  

Try it yourself to see if it works for you.  If you get the message, chase down what it is saying in the logs.  

This ISSUE came up a few times when I tried to search for what could be causing your error, but without the logs, I couldn't tell if this is your issue or not.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.