I taught CSS and JavaScript a few days before learning pcti in phpchina.
Javascript identifier
An identifier is a symbol defined in Javascript, such as the variable name, function name, and array name.An identifier can be composed of
In IE, there are onmouseenter and onmouseleave.
Unfortunately, FF does not. I want to explain again, why does FF not reference such a good function?
There is also onpropertychange in IE, ah, FF, none...
A js section is introduced in the
The following are special HTML webpage effects:
Code Click "run" to view the effect.
Xmlns = "http://www.w3.org/1999/xhtml">
Pinyin search:
A
Adidas
Aee/love
AF
AF baseball cap
Example
Code :
do not eat apple
Try to use W3C dom
The previously accessed objects may be:Document. All. Apple or appleNow we should use:Document. getelementbyid ("apple") is used to access the object, and an ID must be unique on
Below are some examples of direct communication between flash and HTML files using JavaScript. Each example has a simple step.
This article discusses three basic Flash/JavaScript communication methods:Javascript-to-Flash Communication-use the
Javascript Data Type
Number: integer, float type
String: string type data. JavaScript does not distinguish a single character from a string,
Any character or string can be enclosed in double or single quotes.
Boolean: Boolean
Undefined: undefined
CopyCode The Code is as follows:
untitled
Note: 1. The following testcss1 and testcss2 styles are the same as testcss. Only the size is set.2. the height and width of the red part must be defined, which is the height and width of the
In the previous version, this type of effect was first introduced, and three major functions were developed together with limited capabilities. Therefore, only the effect was achieved.
Recently, I have studied the drag-and-drop effect and zoom
Manual decryption is much simpler than imagined. It took less than half an hour to complete the decryption.
The most important part of JavaScript obfuscation:
L Eval, document. Write, vbs execute, execScript, and other functions that can run
The indexof () method returns the position of the first occurrence of a specified string value.
Syntax
Stringobject. indexof (searchvalue, fromindex)
Parameter description
Searchvalue is required. Specifies the string value to be
(1) Introduce eval function usage in Javascript
(2) how to execute global functions
Code
►First, let's talk about Eval usage. The content is relatively simple and you can skip it if you are familiar with it.
The eval function receives a parameter
CopyCode The Code is as follows:
Copy code The Code is as follows: function ()
{
This. V1 = 10;
}
A. Prototype. Print = function ()
{
Alert (this. V1 );
}
Function B ()
{
}
B. Prototype = new ();
New B (). Print ();
The output of running this code
I. SimplifiedCode Using a shorter statement can not only reduce the number of characters entered, but also reduce the file size. The execution efficiency of most code that adopts simple writing is slightly improved.
1.1 simplify definition of
Javascript Regular Expression usage:
Copy codeThe Code is as follows: function checkreg (myreg, mytext)
{
If (myreg. test (mytext)
{
Alert ("OK ");
Return true;
}
Else
{
Return false;
}
}
// ANOTHER METHODCopy codeThe Code is as follows: function
The prototype concept in JavaScript exactly reflects the content of the word. We cannot understand it as a pre-declared concept of prototype in C ++.
All function objects in JavaScript have a prototype attribute. This prototype attribute is an
Js Code
// 1. Determine whether the select option contains an Item with Value = "paraValue"
Function jsSelectIsExitItem (objSelect, objItemValue ){
Var isExit = false;
For (var I = 0; I If (objSelect. options [I]. value = objItemValue ){
IsExit =
Usage: strObj. indexOf (str, startIndex [Optional])
Program code
StrObj is required. String object or text.Str is required. The substring to be searched in the String object.StartIndex is optional. This integer indicates the position where 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