Relative Content

Tag Archive for htmlhttpemail

How do I submit a get request through a non-navigating link?

I’m creating a site that I would like to be as simple as possible. What I would like to do is have a user enter their email address, then an email would be sent with a link containing a token. Here is where I believe the current features of the HTML specification limit me. When the user opens the email and clicks on the link, I would like it to submit the request without navigating. Ideally, the link would change colors if the request succeeded. For example, it is blue by default, when the user clicks on it, it turns orange while the request is being processed, turns green if the request succeeded, and turns red if the request failed. The reason for this is I believe it would be non-ideal for a user to open a screen, type their email address, login to their email, click the link and have another tab open. Ideally, once the user clicks the link and it turns green, the user can navigate back to the login page where a script would poll the server, querying a database to look for a response, download another token into local storage to be used for authentication, then navigate to another page (an authenticated user landing page).