Use hidden frames in Web pages to implement three applications

Source: Internet
Author: User
Tags implement variables variable vars
A Web page frame (frame) is typically used to organize and orchestrate a page layout. In fact, smart application of the frame technology can also accomplish some important functions. This article describes the use of hidden frames to achieve three applications.

How do you hide the frame? The author is to hide the frame by setting the height of the frame (for upper and lower frames) to 0. Hidden in the next frame can still place HTML files, but in the overall layout of the page does not show up. In this case, the author constructs the HTML code for the hidden frame as follows:

〈frameset frameborder= "0" rows= "0,*"
〈frame name= "Hideframe" src= "hidefile.htm" scrolling= "no" noresize frameborder= "0"
〈frame name= "mainframe" src= "main.htm" scrolling= "yes"
〈noframes〉
〈body〉〈p〉please Browse the Web pages with ie4.x/5.x up browser.〈/p〉〈/body〉
〈/noframes〉
〈/frameset〉

wherein, the upper hidden frame is named Hideframe, and the hidefile.htm file is placed. The lower frame places the main file for the page.

First, keep the value of the memory variable
 
In web programming, some variables of the value, such as the user's registration name and ID number, in this login cycle is always the same, in order to be in the Web page file switching process always maintain the value of these variables, some people adopt ASP session variables, but sometimes sessions will be inexplicably lost. In fact, we simply save the values of the variables in hidden frames, and call them when we use them. For example, the contents of the hidefile.htm file in the hidden frame are as follows:

〈form name= "VARs"
〈input type=text user_name= ""
〈input type=text user_id= ""
〈/form〉
Statements that save variable values from other frames to hidden frames are as follows:
〈script language= "JavaScript"
Parent.hideframe.vars.user_name= "User Name"
parent.hideframe.vars.user_id= "User ID"
〈/script>
The statements that take variable values from hidden frames are as follows:
〈script language= "JavaScript"
The_user_name=parent.hideframe.vars.user_name
the_user_id=parent.hideframe.vars.user_id
〈/script>

Second, the production of continuous background music

Friends who set up background music on the home page know that when the background music is flowing smoothly, once you click a link to enter another page, the background music is interrupted, which makes people feel very sorry. In order to keep the background music of the homepage continuous, the problem will be solved perfectly as long as the hidden frame technique is applied skillfully. In fact, the method is also very simple: put the words to set the background music in the hidden frame:

〈embed src= "background music. Mid" hidden= "true" autostart= "true" loop= "0"

Although the next frame of the page is constantly switching between the pages, and the above hidden frames will remain relatively static, the background music will be continuously played.

Third, accelerate the download of the webpage

In order to make their own web pages can download the fastest to the viewer's screen, our web design production staff can not less than kungfu, what the Web page "weight loss", handmade Web pages and other methods readily available. In fact, when a Web browser enters a website, he always stays on the homepage for a little while and looks at the following first. Viewers watch the homepage, the download of the Web page is interrupted, if you can use this time to download other pages, slow down the hard drive, it can greatly speed up the overall download speed of the Web page?

Hiding frames comes in handy! We put some larger pictures, data in hidden frames, let the browser behind the download secretly, wait until the viewer to browse them, they are already on the local hard drive, browsing speed naturally more quickly. Note that when you apply a hidden frame, you place the hidden frame in the lower part of the page and do not affect the normal download of the Web page.



Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.