Skip to content

Instantly share code, notes, and snippets.

@atnan
Forked from wycats/compare.js
Created December 3, 2009 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atnan/247872 to your computer and use it in GitHub Desktop.
Save atnan/247872 to your computer and use it in GitHub Desktop.
// prototype
new Ajax.Request("/your/mom", onSuccess: function(response) { $("lightbox_content").innerHTML = response.responseJSON.contents })
// jquery
$.getJSON("/your/mom", function(json) { $("#lightbox_content").html(json.contents) })
// $.getJSON provides no ability to handle connection/parse errors
$.ajax({ url: "/your/mom", success: function(json) { $("#lightbox_content").html(json.contents) }, dataType: "json" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment