Skip to content

Instantly share code, notes, and snippets.

@jordanandree
Created September 22, 2010 19:47
Show Gist options
  • Save jordanandree/592394 to your computer and use it in GitHub Desktop.
Save jordanandree/592394 to your computer and use it in GitHub Desktop.
<a class="comments" rel="123" href="http://url-to-real-comments-page.com">View Comments</a>
<script type="text/javascript">
jQuery(document).ready(function($){
$('.comments').click(function(){
$.ajax({
type: 'get',
data: { id: $(this).attr('rel')},
url: 'URL HERE', // link to the ajax request file
success: function( response ){
$.fancybox( response );
}
})
// this is needed to prevent the link from loading the HREF
return false
})
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment