Created
May 6, 2012 09:43
-
-
Save DreadKnight/2621287 to your computer and use it in GitHub Desktop.
url get change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var basePage = window.location.href.replace( /#.*/, ""); | |
function showId(id) { | |
TINY.box.show({url:'details.php',post:'id='+id,width:880,height:650,topsplit:2,close:true,callback:function(b){ | |
$(b).click(function() { | |
history.replaceState("", "", basePage); | |
}); | |
}}); | |
history.replaceState("", "", basePage + "#id=" + id); | |
} | |
window.onload = function() { | |
if (/[\#&]id=(\d+)/.test(location.hash)) { | |
var id = parseInt(RegExp.$1); | |
showId(id); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment