The API only supports JSONp. so you need to do the following
$(document).ready(function(){
$("#search").click(function(){
var title = $("#words").val().replace(/\s/g,"+");
var url = "http://api.rottentomatoes.com/api/public/v1.0/movies.json?q="+title+"&apikey=ng6gbx7vdpwmyfwd7vp5g799";
$.ajax(url, {
dataType: "jsonp",
success: function(data){
alert(data.total);
}
});
});
});
See this fiddle: http://jsfiddle.net/rpTm3/
updated fiddle with alert
: http://jsfiddle.net/rpTm3/1/