[UI-Tabs] How-To: Persist selected tab on page refresh / postback.

[UI-Tabs] How-To: Persist selected tab on page refresh / postback.

<script type="text/javascript">
$(function() {
    $('#tabs').tabs({
        selected: (location.hash != "") ? location.hash.replace("#", "") : 0,
        show: function(event, ui) {
            location.hash = $(this).tabs("option", "selected");
        }


    });
});
</script>