Last Updated: February 25, 2016
·
878
· navateja

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
        });
     });
}