Created
February 6, 2015 18:37
-
-
Save Ziiweb/b40e96803f441be4a4e3 to your computer and use it in GitHub Desktop.
This file contains 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
<a href="{{ path('product1') }}">product 1</a> | |
<a class="get-products" href="#">Get more products</a> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
window.onpopstate = function(event) { | |
alert("are you on back?"); | |
} | |
$('.get-products').on('click', function() { | |
var stateObj = { foo: "bar" }; | |
history.pushState(stateObj, ''); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment