Copy codeThe Code is as follows: Insert title here The object itself is passed as a parameter to operate on it. --> select a province Anhui Hebei Henan select a city
Fiddle is very powerful and widely used, but today I will teach you to use fiddle for front-end debugging.
First download the software fiddle and click the corresponding version to download and install.
After the installation is successful, open
The communication between the iframe subpage and the parent page varies depending on whether the src attribute in the iframe is the same-domain or cross-domain link.1. Communication between parent and child pages in the same domain Parent page
Js function method:Copy codeThe Code is as follows: Demo:Copy codeThe Code is as follows: 1 2 3 test I don't know whether there are any more convenient and convenient methods. I tried to get $ ('# sel option [defaultSelected]') through jQuery
(Note that the div must be placed in front of js)Generally, If you bind a dom object to the same event, only the last event will take effect. For example:Copy codeThe Code is as follows:Document. getElementById ("btn"). onclick = method1;Document.
(1)
whitespace = "[\\x20\\t\\r\\n\\f]";Matches the blank space in css3. \ x20: space; \ t horizontal tab (tab); \ r \ n carriage return line feed \ f form feed
(2)
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+"Match any character after \,
JavaScript does not have the concept of classes, so its objects are different from those in class-based languages. I mainly refer to "JS advanced programming", "JS authoritative guide", and "JS essence". This article explains the concept, features,
1. Use the image width display position to play the image. Technology :. offsetWidth, aBtn [I]. index = I, setInterval (), oUl [0]. style. left =, onclick ()2. Apply an array to the image for loop playback. Technology: setInterval (). No onclick
Js function calls can be performed in the following ways:
(1) Direct call of the named FunctionCopy codeThe Code is as follows:Function foo (){}Foo ();
(2) Anonymous functions are called through reference.Copy codeThe Code is as follows:FooRef =
This article describes how to solve the problem of repeated submission in the Enter submission form under IE. For more information, see
Add return false after submit. For example:
The Code is as follows:
Document. formname. submit ();
Return
For the img element in the page, to obtain its original size, take the width as an example, you may first think of width, as shown below:Copy codeThe Code is as follows: The getWH method used here is mentioned in the previous article. The obtained
Sometimes we need to obtain the size of the browser window or screen, the drop-down distance of the window drop-down box, and other data. js provides a lot of solutions to these needs, the meanings of these attributes are easy to be confused when
The Date. prototype. toISOString method is added in ES5, which is not included in ES3, as shown below: This method is not supported in IE6/7/8. You can fix it as follows:Copy codeThe Code is as follows:If (! Date. prototype. toISOString ){Date.
You can use javascript to obtain the width and height of an image. To prevent data errors caused by incomplete image loading, the onreadystatechange event ensures the width of the image, high data accuracy. The Code is as follows:
Var image = new
Summary of the method for refreshing iframe in javascript. If the following iframe exists, the following N methods are used to refresh the iframe:
Method 1: use the name attribute of iframe to locate
Or
Method 2: Use the id attribute of iframe
The js split function is used to split a string into a string array, which is very similar to the explode function in php. The following example describes how to use the function.
The output result is as follows:
223566
The following are official
In js debugging, when the output content is an object and cannot be printed, alert can only print the object identifier, but cannot print the content. This is inconvenient, as a result, we have summarized the following code:
Function writeObj (obj)
Differences among scrollHeight, scrollWidth, scrollLeft, and scrolltop in javascript:
js seat representation generally, you can drag data through mousedown, mousemove, or mouseup, it can only work on a computer device with a normal
Sometimes we do not want users who browse our website to view the source code of our website or right-click to copy the content of our article. So what we can do at this time is to shield the user's right-click action. So that the user does not
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