javascript - Window pushstate, refreshing on back/forward button -
i'm trying page refresh or load whatever data there previously.
i have:
//category select function selectchange(){ $('#sort_by_select').on('change', function(event) { var val = $(this).val(); $('#scene_content').html(''); if (val == 'categories'){ loadgamescategories(); } else if(val == 'az'){ push_url = '?sort=a-z'; window.history.pushstate({page: this.href}, 'games', push_url); loadgamesaz(); }else{ loadgamescategories(); } }); } in php, have set load correct script based on 'sort' variable above. works if refresh page. want people able click on browser , loads previous data.
if explain or show me example, amazing.
thanks!
Comments
Post a Comment