Sometimes, when writing JavaScript to Your webpage, you need to decide whether to use the existing available JavaScript library or write allCode. Each of them has its own advantages and disadvantages, so no method is absolutely correct for everyone.
The ABS method returns the absolute value of a number.
The ACOs method returns the arc cosine of a number.
The anchor method adds an HTML anchor with the name attribute at both ends of the specified text of the object.
The asin method returns the
Nested functions (scope chain)
When nesting a function, you must note that the scope chain actually changes, which may not seem intuitive. You can
Code Changes in the monitoring value of firebug.
Copy code The Code is as follows: var testvar =
Inspired by the use of # To maintain the Page Status in ajax, this javascript + xml SharpRewriter is written to implement url redirection in a pure html environment.
Source code download: http://files.cnblogs.com/cncxz/SharpRewriter1.0.rar
Test
How to read a cookie string:
Copy codeThe Code is as follows:
alert(document.cookie);
The cookie string of a website contains all the cookies under the website domain name (javascript accessible, excluding httponly cookies). Multiple cookies are
Use new Object () to create an Object
There are several methods for creating objects in javascript. Different methods can be used in different scenarios. The simplest is to use the new operator, for example:
Copy codeThe Code is as follows:
In this
Project Practice from the javascript language itselfDulao5 2005-1-15
With the rise of ajax, javascript has gained more and more attention. Importantly, ajax has brought about changes in the web software architecture to some extent. More and more
Scope is one of the most important concepts of JavaScript. To learn JavaScript well, you need to understand the working principles of JavaScript scopes and scope chains. This article briefly introduces the JavaScript scope and scope chain, hoping to
Yesterday shared the http://jscompress.sinaapp.com/this small tool, found that you are still very fond.
So today, I converted it into json. I used json to transmit data and opened APIs.
All functional implementations of this tool are handled by
Js Code
Copy codeThe Code is as follows:
[Code]
In normal calculation, except for the first line (because it cannot be used apart), the rest should get accurate results, from the pop-up results, we found that it was not the correct result we
JavaScript uses "Object-Oriented Programming" or "Object-Oriented Programming. The so-called "Object-Oriented Programming" refers to dividing the scope of JavaScript into large and small objects. objects are still divided into objects until they are
JavaScript allows you to create and open windows that represent HTML text, form objects, and frames. the window object is the top-level object of the JavaScript client hierarchy. The form element and all JavaScript code exist in the document, and
Notes for sorting arrays (sort) in js
Check the code and paste the test results.
Var arrDemo = new Array (); arrDemo [0] = 10; arrDemo [1] = 50; arrDemo [2] = 51; arrDemo [3] = 100; arrDemo. sort (); // After the sort method is called, the
When browsing the Web page, we may have noticed this problem: when we click a link, the browser will take us to another new page. If we want to return, we usually click the back button on the browser, but we want to open the new page, then we can
Nowadays, there are more and more browser types, such as IE, Firefox, Chrome, Safari, etc. So it is not a small function to copy the content of a js file to the clipboard.
Nowadays, there are more and more types of browsers, such as IE, Firefox,
Javascript: Javascript & nbsp; two important techniques for operating form fields. Javascript tutorial description:
Tip 1:
Confirm with the client when the form is submitted or reset
Tip 2:
Lists All elements in a form field and their important
The website is vulnerable to JavaScript injection whenever you accept and re-Display user input. Let's look at a specific application that is vulnerable to JavaScript injection attacks. Assume that a customer feedback website has been created.
The Jquery api provides a method to apply the disabled and readonly attributes to elements, which is recorded here. As follows:
The Jquery api provides a method to apply the disabled and readonly attributes to elements, which is recorded here. As
Recently, we need to use Form Verification for user registration information, and then I checked some information. I will share with you some of the frequently used JS form verification functions that I hope will be useful to you.
Recently, we need
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