Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Why is #_=_ appended to the redirect URI? passport facebook

$(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
  }
})
Comment

Why is #_=_ appended to the redirect URI? passport facebook

<html xmlns:fb='http://www.facebook.com/2008/fbml'>
<head>
        <script type="text/javascript">
        // Get rid of the Facebook residue hash in the URI
        // Must be done in JS cuz hash only exists client-side
        // IE and Chrome version of the hack
        if (String(window.location.hash).substring(0,1) == "#") {
                window.location.hash = "";
                window.location.href=window.location.href.slice(0, -1);
                }
        // Firefox version of the hack
        if (String(location.hash).substring(0,1) == "#") {
                location.hash = "";
                location.href=location.href.substring(0,location.href.length-3);
                }
        </script>
</head>
<body>
URI should be clean
</body>
</html>
Comment

Why is #_=_ appended to the redirect URI? passport facebook

//If #_=_ was appended to the URL:
if(location.hash == '#_=_'){
  //Store the "clean" URL in a variable
  var cleanURL = location.href.split('#')[0];
  //Set the URL to the "clean" URL
  location.replace(cleanURL);
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: nuxt vuetify google fonts undefined 
Javascript :: set up background process in express app 
Javascript :: how to set time with jwt token in node js 
Javascript :: $set 
Javascript :: window.initMochaPhantomJS(); 
Javascript :: Javascript Make your console talk! 
Javascript :: infinite scrolling firestore vuejs 
Javascript :: vuejs install ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 
Javascript :: react conditional if localhost 
Javascript :: react open on different url instead of localhost 
Javascript :: js packages 
Javascript :: react.common.JavascriptException: Error: invalid host 
Javascript :: use vue cdn with firestore 
Javascript :: node express table view 
Javascript :: JsonObjectRequest 
Javascript :: xdebug in blade 
Javascript :: loopback merge data and update 
Javascript :: identify chrome on android using javascript 
Javascript :: p5js add canvas in middle 
Javascript :: reduce javascript acc became numeber insted array 
Javascript :: angular url not valid send you to a component 
Javascript :: check a divide condition and print msg javascript 
Javascript :: como hacer un onpress en react native expo 
Javascript :: blazor auto reconnect 
Javascript :: JavaScript Implementation of Linear Search 
Javascript :: lesson-3 
Javascript :: Play css animation with JS onhover 
Javascript :: react native run on a particular emu 
Javascript :: node code to read json file 
Javascript :: sinon chaining method 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =