Level 16 Level 18
Level 17


10 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

AJAX – Send a Request To a Server
The XMLHttpRequest object is used to exchange data with a server.\n\n\n––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––\n\nSend a Request To a Server\nTo send a request to a server, we use the open() and send() methods of the XMLHttpRequest object:\n\nxmlhttp.open("GET","ajax_info.txt",true);\nxmlhttp.send();\n\nopen(method,url,async) Specifies…
xmlhttp.open("GET","demo_get.asp",true); xmlhttp.send();
A simple GET request
xmlhttp.open("GET","demo_get.asp?t=" + Math.random(),true); xmlhttp.send();
A simple GET request like xmlhttp.open("GET", "demo_get.asp", true); xmlhttp.send(); might get a cached result to avoid this add a uniqe ID to URL
Adds HTTP headers to the request.\n\nheader: specifies the header name\nvalue: specifies the header value
The url – A File On a Server \nThe url parameter of the open() method, is an address to a file on a server:
Async=true When using async=true, specify a function to execute when the response is ready in the onreadystatechange event:
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ajax_info.txt",true); xmlhttp.send();
Async=false To use async=false, change the third parameter in the open() method to false:
xmlhttp.open("GET","ajax_info.txt",false);Using async=false is not recommended, but for a few small requests this can be ok. Remember that the JavaScript will NOT continue to execute, until the server response is ready. If the server is bus…
AJAX – The onreadystatechange Event
When a request to a server is sent, we want to perform some actions based on the response.\n\nThe onreadystatechange event is triggered every time the readyState changes.\n\nThe readyState property holds the status of the XMLHttpRequest.\n\nT…
Which command can you use to find out if the page postback is from an Asynchronous postback
How can you find out which control made the Async postback?