Hyperlinks:
A typical hyperlink: <a href=”/news/showStory?newsid=19371130&lang=en”>Sale now on!</a>When a user clicks on this link, the browser makes the following request:
GET /news/showStory?newsid=19371130&lang=en HTTP/1.1Host: wahh-app.com...The server receives the two parameters in the query string (newsid and lang) and uses their values to determine what content should be presented to the user.Forms
A typical form is as follows:
<form action=”/secure/login.php?app=quotations” method=”post”>username: <input type=”text” name=”username”><br>password: <input type=”password” name=”password”><input type=”hidden” name=”redir” value=”/secure/home.php”><input type=”submit” name=”submit” value=”log in”></form>When the user enters values into the form and clicks the submit button, the browser makes a request like the following:
POST /secure/login.php?app=quotations HTTP/1.1Host: wahh-app.comContent-Type: application/x-www-form-urlencodedContent-Length: 39Cookie: SESS=GTnrpx2ss2tSWSnhXJGyG0LJ47MXRsjcFM6Bdusername=daf&password=foo&redir=/secure/home.php&submit=log+inJavaScript
2 primary reasons to use it:- It can improve the application’s performance, because certain tasks can be carried out entirely on the client component, without needing to make a round trip of request and response to the server.
- It can enhance usability, because parts of the user interface can be dynamically updated in response to user actions, without needing to load an entirely new HTML page delivered by the server.
It is commonly used to perform the following tasks:- Validating user-entered data before this is submitted to the server, to avoid unnecessary requests if the data contains errors.
- Dynamically modifying the user interface in response to user actions; for example, to implement drop-down menus and other controls familiar from non-web interfaces.
- Querying and updating the document object model (DOM) within the browser to control the browser’s behaviour.
<form action=”/secure/login.php?app=quotations” method=”post”>
username: <input type=”text” name=”username”><br>
password: <input type=”password” name=”password”>
<input type=”hidden” name=”redir” value=”/secure/home.php”>
<input type=”submit” name=”submit” value=”log in”>
</form>
When the user enters values into the form and clicks the submit button, the browser makes a request like the following:
POST /secure/login.php?app=quotations HTTP/1.1Host: wahh-app.comContent-Type: application/x-www-form-urlencodedContent-Length: 39Cookie: SESS=GTnrpx2ss2tSWSnhXJGyG0LJ47MXRsjcFM6Bdusername=daf&password=foo&redir=/secure/home.php&submit=log+in
JavaScript
2 primary reasons to use it:
- It can improve the application’s performance, because certain tasks can be carried out entirely on the client component, without needing to make a round trip of request and response to the server.
- It can enhance usability, because parts of the user interface can be dynamically updated in response to user actions, without needing to load an entirely new HTML page delivered by the server.
It is commonly used to perform the following tasks:
- Validating user-entered data before this is submitted to the server, to avoid unnecessary requests if the data contains errors.
- Dynamically modifying the user interface in response to user actions; for example, to implement drop-down menus and other controls familiar from non-web interfaces.
- Querying and updating the document object model (DOM) within the browser to control the browser’s behaviour.
Hiç yorum yok:
Yorum Gönder