Use the document. onreadystatechange method to monitor status changes,
Then, use document. readyState = "complete" to determine whether the loading is complete.
The Code is as follows:
Document. onreadystatechange = subSomething; // This method is executed when the page loading status changes.
Function subSomething ()
{
If (document. readyState = "complete") // when the page is loaded
Myform. submit (); // form submission
}
Five States of readyState loaded on the page
The original article is as follows:
0: (Uninitialized) the send () method has not yet been invoked.
1: (Loading) the send () method has been invoked, request in progress.
2: (Loaded) the send () method has completed, entire response received ed.
3: (Interactive) the response is being parsed.
4: (Completed) the response has been parsed, is ready for harvesting.
Translated into Chinese:
0-(not initialized) The send () method has not been called
1-(load) The send () method has been called and a request is being sent.
2-(Loading completed) The send () method is executed completely and all response content has been received
3-(interaction) parse the response content
4-(complete) The response content has been parsed and can be called on the client