Search code examples
jqueryajaxprototypejs

jQuery equivalent to Prototype Ajax.Request


What would be the jQuery equivalent to the following Prototype AJAX Request?

function showSnapshotComments(snapshot) {
   new Ajax.Request('/photos/show_snapshot_comments/'+ snapshot.id,
                    {asynchronous:true, evalScripts:true});
}

Solution

  • $.ajax({
      url: '/photos/show_snapshot_comments/'+ snapshot.id,
      async: true,
      dataType: 'script'
    });