Answer #1 from this SO post shows a few differences
https://stackoverflow.com/questions/10127937/calling-a-pages-webmethod-from-javascript-on-a-different-page
Your problem most likely lies with the
success portion of your method; you are calling a separate function and not giving it any data to work with.
success: OnSuccess,
failure: function (response) { alert(response); }
-- skip down --
function OnSuccess(data) {
if (data.d != null) { alert(data.d); }
else { alert("Null object!"); }
}
And the first thing I would try is passing that data explicitly to your OnSuccess function
success: OnSuccess(response),
-- OR --
success: function(response) { OnSuccess(response); },
From reading the other answers and comments; it is looking like you are having an issue with Authentication. Is there a log-in requirement that needs to be met?