Magical application of hidden domain in Web page making
Source: Internet
Author: User
Web page in the production, we know that there is an input = "hidden" attribute, as the name implies it is hidden in the Web page of an element, does not appear in the Web page.
So what is the role of it? Friends who have been cgi,asp,php,jsp and so on know that sometimes we have to give the user a message so that he submits it when submitting the form to determine the identity of the user, such as SessionKey, and so on. Of course, these things can also be implemented with cookies, but the use of hidden fields is much simpler. And there will be no browser does not support the user to disable cookies annoyance.
In other times a form has multiple submit buttons, how to make the program can be divided into the end of the user is the button to submit it? We can write a hidden field, and then in each button out with XX "" and then we receive the data first check the command value will know that the user is pressed the button submitted.
And sometimes there are multiple form in a Web page, and we know that multiple form can't be committed at the same time, but sometimes these form do interact, and we can add hidden fields to the form to connect them.
The role of hidden fields in Dynamic Web pages we all see, some people think that hidden domain is a Dynamic Web page of the patent, in the static Web page after all does not work. In fact, the hidden field in the static page is also very large, we know that JavaScript does not support global variables, but sometimes we have to use global variables, we can put the value of the first hidden field, his value will not be lost.
Another example, such as a few days ago, I made a Web page, press a button to pop four small windows, when clicked on one of the small windows, the other three automatically closed. However, IE does not support small windows to call each other, so only in the parent window to write a hidden field, when the small window to see that the value of the hidden field is close when you turn off.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service