Web simulation C/S software login box

Source: Internet
Author: User

ThinkC/SThe Architecture Software login box is in the center of the screenYou can also open an input box when you need to log on to the website background.,After the account password is correct, open the page.(Our predecessors may have already implemented,Here we will talk about our own tests.,Don't shoot bricks)

Start lab now . Think about Web Development Time , JavaScript The commands for opening a form include: Window. open (), There is also a mode window ( Showmodaldialog ), Another idea is to change the page size when you open the page. ( Adjust to the login box size ).

To use Javascript Script Control Form , Add the following commands first. .( Temporary treasure ) The current search function is too powerful,CasualBaiduClick, GoogleClick,Resources one by one,Emotion,The Information Age is fast..Conclusion,For popularizationJSKnowledge I willJavascriptOfWindowObject DescriptionCopyHere we are,You can also go to other tutorials.,Review

Code
Window object


The window object indicates the browser window, which is located at the top layer of the object model.
Set of window objects
Set description
Frames [] Retrieves all the named frames in the window object.

Properties of the window object
Attribute description
Whether the closed window is closed
Default text of the defaultstatus window Status Bar
Document Object
History history object
Length window object frame count
Location object
Name window Object Name
Opener opens the reference of the current window
Parent window
Self returns the reference of the current window
Status window status bar text
Top top-level window

Window object Method
Method description
Alert ([Message]) displays a window with a warning message and a "OK" button
Blur () removes the focus of this window
Clearinterval (iintervalid) cancels an interval event that was previously identified as iintervalid starting with the setinterval Method
Cleartimeout (itimeoutid) cancels a time-out event that was previously identified as itimeoutid starting with setTimeout.
Close () Close current window
Confirm ([Message]) displays a window with confirmation message, with "OK" and "cancel" buttons
Createpopup () Creation dialog box, which returns a reference to the window object.
Focus () to make this window focus
MoveBy (x, y) moves the position of the window to the specified x and y offset values.
MoveTo (x, y) moves the screen position in the upper left corner of the window to the specified x and y positions.
Open () opens a new window to display the specified page
Print () prints the document associated with the window
Prompt ([Message] [, defaultvalue]) displays the prompt dialog box, with an input box containing the message and default defavalue value, and returns the string entered by the user.
ResizeBy (x, y) changes the offset of the specified X and Y to the current position of the window.
ResizeTo (x, y) changes the window size to the specified width value x and height value Y
Scrollby (x, y) rolls the window x and y offset
Scrollto (x, y) Scrolls the window to the specified x and y offset.
Setinterval (Code, MS [, language]) is executed every milliseconds Code Code, language specifies the language attribute. Returns an integer ID so that the clearinterval method can cancel the timer.
SetTimeout (Code, MS [, language]) executes the code in milliseconds, and language specifies the language attribute. Returns an integer ID so that the cleartimeout method can cancel the timer.

 

During the review, we can see that there is a resizeTo method in the window object that changes the specified size; the moveTo method moves to the specified location, and they are the two)

New Page 1.htm

Enter the following simple code:

 

Code
< Script Type = " Text/JavaScript " >

Window. resizeTo ( 400 , 300 );
Window. moveTo ( 600 , 200 );

</SCRIPT>

 

The window size is changed.,The problem that follows is,HowMenu,ToolbarAfter checking all the information for a long time, I only blame myself for poor learning skills (when books are used, I hate less). By the way, I would like to keep a record of Chairman Mao's words, "study hard and go up every day ". We can't stop it. This one doesn't work. Let's go another way.

Used belowWindow. OpenMethod.

 

Code
Use a small example to describe the window. Open parameter. Note: This example is useless online.
Window. Open ( " Page.html " , " Newwindow " , " Height = 100, width = 400, toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = No " );

Window. Open command to pop up a new window;
' Page.html ' The name of the pop-up window;
' Newwindow ' The name (not the file name) of the pop-up window. It is optional and can be empty. '' Replace;
Height = 100 Window height;
Width = 400 Window width;
Top = 0 The pixel value between the window and the top of the screen;
Left = 0 The pixel value between the window and the left side of the screen;
Toolbar = No indicates whether to display the toolbar. Yes indicates display;
Menubar and scrollbars indicate the menu bar and scroll bar.
Resizable = No. Whether to change the window size. Yes indicates yes;
Location = No indicates whether the address bar is displayed. Yes indicates yes;
Status = No indicates whether to display information in the status bar (usually the file has been opened). Yes indicates yes;

 

After the popularization, we started construction. The main idea was to use a page as a stepping stone, open a window directly, open a child window, and close the parent window. New 2.htm(page jump, 3.htm (login page)

 

Code
2 The. htm code is as follows:
< Script Type = " Text/JavaScript " >

Window. Open ( " 3. htm " , " Newwindow " , " Height = 100, width = 400, toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = No " );
Window. Opener = Null ;
Window. Close ();

< / SCRIPT>
3 .Htmis the frame code (remove the script code from 1.htm)

 

The effect has taken a small step towards what we want.,There is no collection when opening,Toolbar,Address Bar.Let's take a look at the code.,You will know.,Pair, JSThe script is only available inIERunning properly on,Problems Found,Try again,UseJSDetermine the browser type of the Client,NoIEDirectly open the logon page(Locaction. href ).

The simple code is as follows::

 

 

Code
< Script Type = " Text/JavaScript " >
If (Navigator. useragent. indexof ( " Firefox " ) ! =- 1 )
{
Otheropenwindow ();
}
Else If (Navigator. useragent. indexof ( " Maxthon " ) ! =- 1 )
{
Otheropenwindow ();
}
Else If (Navigator. useragent. indexof ( " Safari " ) ! =- 1 )
{
Otheropenwindow ();
}
Else If (Navigator. useragent. indexof ( " Camino " ) ! =- 1 )
{
Otheropenwindow ();
}
Else If (Navigator. useragent. indexof ( " Konqueror " ) ! =- 1 )
{
Otheropenwindow ();
}
Else If (Navigator. useragent. indexof ( " MSIE " ) ! =- 1 )
{
Ieopenwindow ();
}
Else
{
Otheropenwindow ();
}


Function Ieopenwindow ()
{
Window. Open ( " 3. htm " , " Newwindow " , " Height = 100, width = 400, toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = No " );
Window. Opener = Null ;
Window. Close ();
}
Function Otheropenwindow ()
{
Location. href = " 3. htm " ;
}

< / SCRIPT>

User-AgentThe parameters are not described here. You can use fidder to view the User-Agent parameter values of each browser.

 

Token ).

 

Summary: omitted.

 

Download instance

Supplement:

I went to ublue. Liao's blog yesterday and went to his elf tribe. It worked well. Let's talk..., ha ..

 

 

Refer:

Http://www.diybl.com/course/1_web/javascript/jsjs/20071226/94568.html

Http://blog.sina.com.cn/s/blog_49df2d0b01009epq.html

 

 

 

Related Article

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.