OAuthを暗黙的に使用するAPIを使用しています。URLhttp://exmaple.com/#token=084758yhroufgbk48yにリダイレクトされます。
JavaScriptを介してこれを取得するにはどうすればよいですか?ありがとう
OAuthを暗黙的に使用するAPIを使用しています。URLhttp://exmaple.com/#token=084758yhroufgbk48yにリダイレクトされます。
JavaScriptを介してこれを取得するにはどうすればよいですか?ありがとう
URLのハッシュ部分は次を使用して取得できますwindow.location.hash
URLからトークンを取得するには、次のコードを使用します。
<script type="text/javascript">
hash = window.location.hash.substr(1); //url of the current page
arHash = hash.split('='); //this creates an array with key ([0] element) and value ([1] element)
hash_value = arHash[1]; //recieve value
</script>