Welcome Guest, Not a member yet? Register   Sign In
Using controller actions using jQuery AJAX?
#6

[eluser]Colin Williams[/eluser]
$.load() is good if you just need to grab some content. $.ajax() is more robust and is typically what I shoot for.

Code:
$.ajax(
   {
      type: 'get',
      url: '/bookmark/user/32',
      success: processAjax,
      error: showError
   }
);

// ...

function processAjax(data, status)
{
   if (data == 'true')
   {
      // Things went well...
   }
   else {
      // There was an error
   }
}

function showError(XMLHttpRequest, textStatus, errorThrown)
{
   // There was an error with the request
}


Messages In This Thread
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 06:39 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 06:51 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:04 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:08 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:13 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:26 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:28 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:32 AM
Using controller actions using jQuery AJAX? - by El Forum - 02-09-2009, 07:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB