Skip to content

Instantly share code, notes, and snippets.

@orioltf
Created August 27, 2013 08:17
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 orioltf/6350978 to your computer and use it in GitHub Desktop.
Save orioltf/6350978 to your computer and use it in GitHub Desktop.
#JQUERY #WebEnhancer: Get whole description from each "more" link in FrontendConf via AJAX
var $talks = $('.schedule').find('article.talk');
$talks.each(function(){
$(this).on('click', 'p > a', function(e){
e.preventDefault();
var linkRef = $(this).attr('href'),
urlHash = linkRef.substring(linkRef.indexOf('#')),
urlWithoutHash = linkRef.substr(0,linkRef.indexOf('#')),
$container = $(this).closest('p');
$container.load(urlWithoutHash+' '+urlHash+' > .speakers-right > h3 + .desc');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment