You know JavaScript? Please answer, understand JavaScript?
Quick testing truly understands JavaScript core closures and out-of-scope. These five small scripts. Try to answer what is a reminder that it is not running on the console in every situation. Then you can create a test file to easily check your answers. Are you ready?
if (!("a" in window)) { var a = 1;}alert(a);
var a = 1, b = function a(x) { x && a(--x); };alert(a);
function a(x) { return x * 2;}var a;alert(a);
function b(x, y, a) { arguments[2] = 10; alert(a);}b(1, 2, 3);
function a() { alert(this);}a.call(null);
Do you understand javascript POST? Answer my questions if you understand.
You may need to write a script for specific implementation.
Var xhr = new XMLHttpRequest ();
Xhr. open ("POST", url, true );
/* The first parameter is the request method. Generally, the get and post methods are used, which is similar to the form label method.
The second parameter is the request URL.
The third parameter indicates whether the request is synchronous or asynchronous. true indicates asynchronous.
When the open method is called, only parameters are passed */
Xhr. onreadystatechange = function (){
If (xhr. readyState = 4 & xhr. status = 200 ){
Alert (xhr. responseText );
}
};
Xhr. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded ");
Xhr. send (parameter); // After the send method is called, the request parameters are changed to the "source code" you wrote last"
Understanding javascript
The compilation cannot be stopped. All html files must be parsed by the browser after being generated, and JavaScript files are also used. In this way, all contents have been run. If you do not want to display them, javascript can obtain the html content and hide it with the display: none attribute.
Or, after reading the specified content, set its innerHTML = ""
As for how to obtain it, you can identify the content by ID