Popups like coderwall or facebook (url change but no redirect)
HTML <br/>
<a href = "coderwall/123" rel = "popup_link"> </a>
<dl> Javascript code: (I'm using colorbox for popup) </dl>
$(function(){
$("a[rel=popup_link]").on("click", functiion(e){
e.preventDefault();
var url = $(e.target).attr("href");
//to get the ajax content and display in div with id 'content'
if(url != window.location){
window.history.pushState({path:url},'',url) ;
}
$.colorbox({
inline: true,
href: "<your content>",
open: true
});
});
}
Written by nava teja tummalapalli
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Pushstate
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#