Javascript string object instance
Returns the length of a string.
Add a style to a string
Returns the first occurrence location of the specified text in the string-indexof () method.
About this quiz
This test contains 20 questions. The maximum Answer time for each question is 20 minutes (this is because the default validity period for each session is 20 minutes ).
This test is an unofficial test. It only provides a tool to
Functions in javascript:
1. It can be used as the return value, parameter or variable value.
2. nested definitions are supported.
3. The function can reference external variables (nested scope ).
In this way, there is a problem. The scope chain of
1. Where the object comes from
First, let's look at what an object is. You can get an explanation by searching for Wikipedia. In object oriented, an object is a class) instance, so you must first have a type before you have an object, and then
Making a simple flvplayer is very simple, and it is far from powerful. After Google, we found an open-source video player named pai_flv_player, which can also be used as an MP3 player.Javascrui can control the player to play/pause, stop, increase
1. Call JavaScript Functions in Silverlight
Using some Silverlight classes in the system. Windows. Brower namespace, you can call a JavaScript function written in a script. This gives your Silverlight code a regular way to interact with the
JSON (JavaScript Object Notation) is a simple data format, which is lighter than XML. JSON is a javascript native format, which means that no special API or toolkit is required to process JSON data in JavaScript.
JSON rules are simple: the object is
Let's take a look at the explanation of call in the JS Manual: Call Method
Call a method of one object to replace the current object with another object.
Call ([thisobj [, arg1 [, arg2 [, [,. argn])
ParametersThisobjOptional. Will be used as the
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->// Whether the textbox of the certificate is null
// Usage: var textboxids = new array ("txtusercode", "txtpwd ");
// Var flag = textboxisempty
The following are four basic methods for JavaScript to access cookies:
// Utility function called by getcookie ()Function getcookieval (offset ){VaR endstr = Document. Cookie. indexof (";", offset );If (endstr =-1 ){Endstr = Document. Cookie. length;
We all know that there are three ways to create a form element in IE: var oinput = Document. createelement ("input ");
VaR oinput = Document. createelement (" ");
VaR oinput = Document. createelement (" ");
In Firefox, only var oinput = Document.
VaR bodywidth = Document. Body. clientwidth; // visible area width of the webpage
VaR bodyheight = Document. Body. clientheight; // The visible area of the webpage is high.
VaR bodywidthwithborder = Document. Body. offsetwidth; // visible area width
1: Get the server-side control
Document. getelementbyid (" ");
2: use regular expressions to restrict text box input in a webpage form:
1>. use regular expressions to restrict Chinese characters only: onkeyup ="Value = value. Replace (/[^ \ u4e00-\
2. Basic JavaScript Data Structure
Programming in the scripting language is very similar to that in C ++. It only removes pointer-related errors in the C language and provides a powerful class library. For people who already have C ++ or C, it is
When a page is loaded, Javascript in the body is executed.
When called, the JavaScript code in the head part is executed.Instance
Head Section
The script containing the function is located in the head part of the document. In this way,
Document directory
Javascript has two different types of loops:
Syntax:
Instance:
Result:
Syntax:
Instance:
Result:
Syntax:
Instance:
Result:
The loop in Javascript is used to specify the number of times the same code is executed (or
Javascript can be used to verify the input data in the HTML form before the data is sent to the server.Javascript Form Verification
Javascript can be used to verify the input data in the HTML form before the data is sent to the server.
Typical form
The date object is used to process the date and time.Javascript date object instance
Returns the date and time of the current day.
How to Use the date () method or the date of the current day.
Gettime ()
Use gettime () to
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