In Firebug I see the request and all the data is present. But in an attempt to even just do a simple alert of console.log they get completely bypassed. What exactly am I doing wrong that the alert is never hit?
var feedPage = 1;
var rowsToGet = 10;
$(function() {
var urlString = "cfc/getFeed.cfc?method=" + 'getFeed' + "&page=" + feedPage + "&rows=" + rowsToGet + "&userID=" + 2;
$.get(urlString, function(jsonData) {
alert(jsonData); // never happens
},"json");
//displayResults(feedData,feedPage,rowsToGet);
});
Add an error handler to your ajax call to see why it is failing.
var feedPage = 1;
var rowsToGet = 10;
$(function() {
var urlString = "cfc/getFeed.cfc?method=" + 'getFeed' + "&page=" + feedPage + "&rows=" + rowsToGet + "&userID=" + 2;
$.ajax({
url: urlString,
type: "GET",
dataType: "json",
// remove everything before the opening bracket
dataFilter: function(data) {
return data.replace(/^.+(\[|\{)/,"$1");
},
success: function(jsonData) {
//alert(jsonData); // never happens
console.log(jsonData);
//displayResults(feedData,feedPage,rowsToGet);
},
error: function(w,t,f) {
//alert(w + "
" + t + "
" + f);
console.log(arguments);
});
});
});
This could very well be because the return data is not a valid JSON string. try console.logging without specifying the datatype to be "json" at the end of your $.get call.