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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...