Using the JavaScript framework
When we talk about the Window object, we mentioned that a Web page within a frame is also a Window object, that is, a frame object is also a Window object. The easiest thing to understand is that each HTML file
Let's take a look at two pieces of code that detect the byte length of a string, respectively, with a For loop and a regular expression:
The For loop detects a string's byte length method one:
Copy Code code as follows:
var lenfor =
First convert the user's input value to uppercase (or lowercase), and then compare:
var name = Document.form1.txtUserName.value.toLowerCase ();
if (name = = "Urname")
{
//statements go to here.
}
JavaScript
9. JavaScript annotations (Comments in JavaScript)
Q: How do I insert comments in JavaScript code?
A:javascript supports three different types of annotations:
Multiple-line C-style annotations. The content included in/* and/* is commented, for
Sometimes the page will have an input box, the user input content will be displayed in the page, similar to the web chat application. If the user enters a JS script, the scale: , the page pops up a dialog box, Or the input of the script to change
Cursor with JavaScript for outbound links-Beautiful Styl E«style of the United States»loaoao.com cursor with JavaScript for outbound links the was used for its own use, Did not put the picture path written as a variable to save, Link
In JavaScript, the global environment itself is an object. This object is window in the browser host, and when JavaScript is used in other non-browser hosts, such as an embedded environment, it may be another object.
It also corrects the idea that
1,javascript's prototype Model: prototype needs a constructor to define a member of an object when implementing an object-oriented (like defining a Class), and the method is attached to the constructor's prototype.
In 2,javascript, in order to
What are functions (function)function sum (a,b) {return a+b;}In fact, the popular saying is a name of the Code section, convenient reuse.To be aware of:1.Javascript function syntax, because Javascript itself is case-sensitive, so a function cannot
the use of Window.opener
Window.opener returns a reference to the window that created the current window, such as clicking a link on the a.htm and opening the b.htm, and then we're going to enter a value on the b.htm and give it a TextBox with ID
Both simple and complex web applications are made up of HTML, JavaScript, and CSS files. Developers typically use a third-party JavaScript framework such as jquery, knockout, underscore, etc. to improve development speed. Because these JavaScript
This is the model that was introduced in earlier versions of the JavaScript language. Everyone is supported by all browsers, but only allows access to certain key parts of the file, such as forms, form elements, and images.
The model provides
This method returns the inverse chord of the radian number. The Asin method returns the numeric value between 1 and 1, X-PI/2, and PI/2 radians. Returns Nan if the value of the number is outside this range.Grammar
Math.asin (x);
The
Document Object
The following table lists the Some common properties of the Document object for the BOM:
of the genus
say
Alinkcolor
activated link colors, such as definition of *
In general, we use the direct amount of the function in JS to name a simple function.
This is also legal in IE or Mozilla (the ECMA Standard has a definition of the direct quantity of the function).
But there is another simpler way of naming in
First look at how to click a button on the project WebView, you can reach the calling OC code
The above page is nested inside the webview of a project page, print order after clicking (Click event is a JS method), need to call the OC inside the
Break
function Mybreak () {for
(var i = 0; i
Output:
012
Break: Jump out of the current loop, start from outside the current loop, ignore any other statements in the loop body and test for cyclic conditions. It can only jump out of
Javascript closures
Closures, Javascript is a more important concept, for beginners, closure is a particularly abstract concept, especially the definition of ECMA specification, if there is no combat experience, it is difficult to understand it
The JavaScript date.getday () method returns the day of the week by local time to the specified date. The value returned by Getday is the integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.Grammar
Returns the day of the month, on a specified date, by the JavaScript date.getdate () method of the local time. The value returned by getdate is an integer between 31 and 1.Grammar
Date.getdate ()
The following are the details of the
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