Is form the only source of data submitted by the user? We can use form to upload files, input values, and url-based values are submitted through form. is form the only source of data submitted by users? ------ Solution ------------------ simply put, the XMLHttpRequestXMLHttpRequest object provides full access to the HTTP protocol, including POST and form. Is it the only source of data submitted by the user?
We can use form to upload files, input values, and url-based values are submitted through form. is form the only source of data submitted by users?
------ Solution --------------------
Simply use XMLHttpRequest
The XMLHttpRequest object provides full access to the HTTP protocol, including the ability to make POST and HEAD requests and common GET requests.
------ Solution --------------------
If ajax is used, no form is required. Values can be passed without tags.
For example, jquery. ajax:
Click
$ ('P'). click (function (){
Var value = values (this).html (); // for example, pass
Tag HTML content: click to go to the somelink. php page.
$. Ajax ({
Url: "somelink. php", // "somelink. php? Name = "+ value,
Type: 'post', // 'GET ',
Data: "name =" + value, // POST requires data, get just writes the value into the URL
Success: function (data ){
// Console. log (); print the transfer information.
}
});
------ Solution --------------------
Http is an interactive format... it is a text protocol based on TCP/IP...
That is to say, for servers that follow the HTTP standard, you can tell them the request content using the same HTTP standard protocol ..
The most common client is the browser, and the most common request methods in the browser are form submission and GET requests...
In fact, all parts of the HTTP request are submitted to the server, such as the query string, HOST name, request method, request body, and so on ..
The form you mentioned here generally regards it as the request body data submitted by the POST method. it is the most common and most common way to submit various data in the browser, but it is not the only one.
------ Solution --------------------
You can also use soket to simulate post.