I have <script>var foo=bar;</script> .I want to write a fucntion in the same script tag which sends data (bar) to http://example.com/get-data/.
I don’t know much knowledge about js.
<body>
<script>
var hash_token = window.location.hash;
removed_hash_token=hash_token.slice(1);
alert(removed_hash_token)
get_token_url="http://localhost:8000/"
</script>
</body>
see I have hash fragment after login google redirecting in url,so I take hash and remove it and I want to send this to backend .
>Solution :
look at this https://www.npmjs.com/package/axios
Promise based HTTP client for the browser and node.js