Javascript obtains the page width, height, window width, and height.

Code instance: obtain the page scroll height scrolltop (for: ie5.0 +, firefox1.06 + ...) Function ietruebody (){Return (document. compatmode & document. compatmode! = "Backcompat ")? Document.doc umentelement: Document. Body;}

Use JavaScript to set webpage shortcuts

In many web pages, you can use shortcuts to complete certain actions. For example, you can press Ctrl + enter to publish after the discuz forum is complete! This function is implemented by using the keycode method of the event attribute in

Weird time issues in Javascript !!

The following methods are used to create a new time in javascript:VaR today = new date ();Returns the current date and time.VaR newyear = new date (December 31,199 8 23:59:59 );The input is the form string "month, day, year, hour: minute: second"VaR

Passing variables in VBScript and JavaScript

How to pass variables in VBScript and JavaScript (including servers and clients) I. Recently, some netizens have asked me how to use VBScript and javascipt to pass variables. I don't know why. Because almost all scripting languages can complete

Verify the Regular Expression of yyyy-mm-dd hh: mm: SS in JavaScript.

^ (\ D {2} ([02468] [048]) | ([13579] [26]) [\-\/\ s]? (0? [13578]) | (1 [02]) [\-\/\ s]? (0? [1-9]) | ([1-2] [0-9]) | (3 [01]) | (0? [469]) | (11) [\-\/\ s]? (0? [1-9]) | ([1-2] [0-9]) | (30) | (0? 2 [\-\/\ s]? (0? [1-9]) | ([1-2] [0-9]) | (\ D {2}

Javascript binding event

From: http://hi.baidu.com/thenatureofspaceandtime/blog/item/c4ab61f4e842ca6ddcc4742f.htmlThe simple binding time seems to be effective only when loading for the first time.Document. getelementbyid ('yourhtmlelement'). onclick = Haha;Function Haha (){

Copy the input content to the clipboard using JavaScript.

Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Html > Head > Title > Copy the input content to the clipboard using JavaScript. Title/ > Script Language

With statement in Javascript

Make your JavaScript code more readable using the with () Statement The with () Statement in Javascript is identical to the with statement found in Visual Basic. using with (), you can reduce object references and make your code more readable.

Example of the exec and test methods in the Javascript Regular Expressions!

After applying the regular expression to the URL shown above, the Child match contains the following content:A [1] contains "HTTP"A [2] contains "msdn.microsoft.com"A [3] contains ": 80"A [4] contains "/scripting/default.htm"(You can also use Regexp.

Use activexobject in JavaScript to create FileSystemObject operation files

I. function implementation core: FileSystemObject object To implement file operations in Javascript, FileSystemObject objects are primarily used. Ii. FileSystemObject Programming It is very easy to program with FileSystemObject object. Generally,

Common JavaScript Functions

// Function name: chksafe // Function Description: Check whether "'",' \ ', "/" is contained "'",'\\',"/" // Parameter description: the string to be checked // Return value: 0: Yes 1: No Function chksafe () { Return 1; /* Maid = new array ("'","\\","

Replace () method in Javascript

In JavaScript, the string function Replace () is quite popular. Its flexible and powerful character replacement processing capability makes me want to introduce it to you. Replace () is a simple replacement of characters. ExampleCodeAs follows:

Use of try catch finally in Javascript

Try... catch... finally statement Implements error handling for JScript. Try { Trystatements} Catch (exception ){ Catchstatements} Finally { Finallystatements} ================== Parameters Trystatement Required. An error may

Operations related to select in Javascript

JavascriptAboutSelectRelated Operations I, Insert Option 1,DomMethod VaROselectyear = Document. getelementbyid ("Selectyear"); VaROP = Document. createelement ("Option"); Op. innerhtml ="2010"; Op. value ="2010"; Oselectyear.

Javascript Disable or other tag in Other Browser like FF, Chrome

If you are the same as me, unfortunately you have maintained a javascript, which is widely used in non-input, textbox, and other html tags. disable = true. function. this code is unfortunately compatible with other non-ie browsers. The following

The relative path of the javascript file on the master page

A problem that often puzzles developers is how the master page handles relative paths. If you are using static text, this problem will not bother you. However, if you add a tag or an HTML Tag pointing to another resource, the problem may

Set webpage shortcut keys in JavaScript

This function is implemented by using the KeyCode method of the event attribute in JavaScript and driven by the onKeyDown event.In JavaScript, you can use the keyCode attribute to obtain the ASSCII code value that the user presses. For more

Javascript confirmation dialog box

If (confirm ("Confirm delete? ")) { }

Practical application of showModalDialog in JavaScript

The showModalDialog () method provided by IE is a very useful Web application function. Although the General website application is not very common, once it involves enterprise application-level Web development, it is very useful. Now, let me use a

Javascript: connect to the database

Javascript: connect to the database  

Total Pages: 5378 1 .... 2602 2603 2604 2605 2606 .... 5378 Go to: GO

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.