Facebook Callback appends '#_=_' to Return URL

前端 未结 23 2162
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 14:56

Facebook callback has started appending #_=_ hash underscore to the Return URL

Does anyone know why? What is the solution?

23条回答
  •  盖世英雄少女心
    2020-11-22 15:28

    if you want to remove the remaining "#" from the url

    $(window).on('load', function(e){
      if (window.location.hash == '#_=_') {
        window.location.hash = ''; // for older browsers, leaves a # behind
        history.pushState('', document.title, window.location.pathname); // nice and clean
        e.preventDefault(); // no page reload
      }
    })
    

提交回复
热议问题