For correct work in IE 8 you need to place initialization history.js and History.Adapter.bind
inside $(document).ready(...)
This will work in all browsers...and IE 8 to
@Scripts.Render("~/bundles/history")
<script type="text/javascript">
$(document).ready(function () {
var History = window.History;
History.Adapter.bind(window, 'statechange', function () {
try {
var State = History.getState();
$('#Products').load(State.url);
} catch (e) {
}
});
});
function change(id, ItemMenu) {
var url = $('#' + id).val();
try
{
History.pushState({}, null, url);
}
catch(e)
{
}
}
</script>