Jump to content
s_avinash_s

getting data once only

Recommended Posts

Hi

I need to get a data only once using 

xhttp.open("GET", "url",true);

But i dont have any button, only when the server and client are running at first, only first it should get a data and later should not.

 

Share this post


Link to post
Share on other sites

The client only runs on a event, with button it would be .onclick, a form .onsubmit, with none of these you are left with event .onload which it usually attached to window. that only runs when the document has fully rendered.

https://www.w3schools.com/jsref/event_onload.asp

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×