1 <script type = "text/javascript"> 2 // var a = 1; 3 // alert (window. a); 4 // a belongs to an attribute in the window. 5/* function show () 6 {7 alert ('A') 8}; 9 window. show () */10 // alert (a) ---- errors and alert (window. a) ---- the result is undefined; Difference 11 </script>
1 <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2
Request status monitoringOnreadystatechangeEvent
ReadyStateAttribute:
Request status
0 (not initialized) has not called the open () method
1 (load) The send () method has been called and the request is being sent.
2 (Loading completed) send () method completed, all response content has been received
3 (parsing) parsing the response content
4 (complete) The response content is parsed and can be called on the client
Status attribute: Request result. If the call succeeds
ResponseText returns the file content 200. If the file fails, a number such as 404 is displayed.