Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Post request from html using javascript

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 .

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

look at this https://www.npmjs.com/package/axios

Promise based HTTP client for the browser and node.js

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading