I have the below jQuery code:
$(document).ready(function ()
{
$('#ajaxButton').click(function ()
{
$.ajax({
url: 'ajax/getsomestring',
type: 'GET',
success: function (data)
{
alert('test');
}
});
});
})
On the button click, I want to do an AJAX call. On my server-side, I do have an action method GetSomeString(), which returns a string. I’m just testing to make sure the AJAX request is successful by a simple alert(). But for some reason, Firebug is giving me the error:
s is undefined
What am I doing wrong here?
Edit:
In Firebug, the error is actually referenced in the jquery-1.5.1-vsdocs.js script (like 7320). Obviously I didn’t write that code, nor do I think that’s the problem. I only get this error when I use my $.ajax() call.
The issue was actually with the jquery-1.5.1-vsdocs.js JavaScript file. For some reason, it was throwing the above error in the $.ajax() call. Once I took the script reference out, and it didn’t get loaded the AJAX request worked.
Any ideas or theories as to why this caused the issue would be much appreciated. But the removal of it fixed the code.