Skip to content

Instantly share code, notes, and snippets.

@StevenLangbroek
Created December 2, 2012 12:52
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 StevenLangbroek/4188501 to your computer and use it in GitHub Desktop.
Save StevenLangbroek/4188501 to your computer and use it in GitHub Desktop.
Ajaxify Calendar
$(function(){
$('.ajax_link').on('click', function(e){ // catch the click, and bind that click-event to the variable "e"
e.preventDefault(); // stop the event from firing (so user doesn't get forwarded to the actual link)
var elem = $(this),
link = elem.attr('href'),
target = elem.attr('rel');
$.get(link, function(data){ // do a GET-request
$(target).html(data); // put the results in the target-element
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment