There are a few queries about ajax

Updated on society 2024-04-04
7 answers
  1. Anonymous users2024-02-07

    JS native implementation of AJAX

    AJAX establishes a connection to the server, receives requests from the server, and processes the data returned by the server.

    Development Steps:1Create an XMLhttpRequest object.

    2.Receives a response from the processing server.

    3.Open the connection to the server.

    4.Send data.

    Create an XMLhttpRequest object.

    function ajaxfunction()

    return xmlhttp;

    click function

    ok").onclick=function(){

    1.Get the xmlhttprequest object.

    var xmlreq=ajaxfunction();

    2.Process the server's response.

    There is a readyState attribute in the XMLhttpRequest object.

    The readystate property represents the current state of the AJAX request. Its value is represented by numbers.

    0 means uninitialized. The open method hasn't been called yet.

    1 means loading. The open method has been called. But the send method is not called.

    2 means that it has been loaded. send has been called. The request has begun.

    3 represents interactive. The server is sending a response.

    4 means finished. The response is sent.

    if( by comparing this value to 200 (everything is fine, the server processed it successfully) or 304 (the source file has not been modified).

    if( Receives server-side data.

    var data=;

    alert("data:"+data);

    3.Open the connection to the server.

    open(method,url,asynch)

    method request method get post

    The path of the URL request.

    asynch: indicates whether the request is to be transferred asynchronously, and the default value is true (asynchronous).

    alert(new date().gettime()) (to solve the problem with caching).

    If you use POST to request data sent by the server.

    Need to will"content-type"The header is set to"application/x-www-form-urlencoded"。It tells the server that the data is being sent.

    And the data is already URL-encoded.

    The method must be placed after the open method.

    4.Send data.

    If you select a get request, no data will be sent, just pass null to the send method.

    b=45&c=23");

  2. Anonymous users2024-02-06

    Take a look at the jquery documentation and you'll be ajax.

  3. Anonymous users2024-02-05

    The page will not be refreshed (it will not flash when clicked), and without refreshing, a control such as textbox will be submitted back to the server, and then the server will read the submitted control or data and perform addition, deletion, and modification.

  4. Anonymous users2024-02-04

    It's asynchronous transfer technology.

  5. Anonymous users2024-02-03

    That's right. with'get'When submitting, the data in the form is passed in the form of parameters.

    The arguments on the address are redundant.

    with'post', the form data is passed with post, and the parameters on the address can continue to be transmitted.

  6. Anonymous users2024-02-02

    First of all, to implement AJAX technology, you have to reference js**, write directly to the page or reference an external js file, but in any case can be seen by the programmer (by using firbug or other debugging tools made by other web pages).

    There can be many styles for referencing JS, and they all need to be there.

    3. Use pseudo (some browsers are invalid and difficult to achieve) pseudo**.

  7. Anonymous users2024-02-01

    1. The biggest point of the most disturbance is that the page is not refreshed, and the server communicates with the server in the page, which gives the user a very good experience.

    2. Use asynchronous mode to communicate with the server, no need to interrupt the user's operation, and have a more rapid response ability. Li Xu.

    3. The work of some previous server burdens can be transferred to the client, and the idle ability of the client can be used to deal with it, so as to reduce the burden of the server and bandwidth, and save space and broadband rental costs. And to reduce the burden on the server, the principle of AJAX is "data on demand", which can minimize the burden on the server caused by redundant requests and responses.

Related questions
23 answers2024-04-04

1.If there is a signature from the employer, it is valid. >>>More

19 answers2024-04-04

The front is just foreshadowing, as I said before, Chen Dong is the god of pits, he likes to dig pits in front and fill them slowly in the back, so Li Xiaoman is the key figure in the future, Ye Fan will most likely preach, and in the end, there is likely to be a fairy world, and generally he will not name himself, and maybe even the fairy world is the earth.

22 answers2024-04-04

Let me tell you if there is a way to determine the relative movement trend. >>>More

5 answers2024-04-04

Contradictory question: let s go, shall we? Meaning: Let's go, how's it? >>>More

7 answers2024-04-04

The first question is more difficult, you can use hi to tell me about the specific situation. >>>More