I recently learned about Ajax and accidentally found that a series of articles on IBM developerWorks, "Mastering Ajax", not only explained the principles of Ajax, I also gave a detailed description of the principles of Web XML, server correspondence,
Difference between js setTimeout and setInterval, js setinterval js settimeout setinterval window. setinterval flash setintervalSetinterval parameter clearing setinterval asp setinterval as setinterval stop
Let's take a look at the example to
Several js functions for beginners,
Function JugeComment (myform )//Determines whether the user name is empty and sets it to focus{If (document. myform. UserName. value = ""){Alert ("your user name cannot be blank! ");Document. myform. UserName.
Let's take a look at Google's Smart Tips,
First, we can see that there are three files. The test.htm file is the test file, and the css.css style list. google. js is the js processing file. I will write the code one by one and share it with
Javascript effect:A non-stop floating image changes the floating direction when it encounters any side of the browser, just like a ball. This effect is mainly used for website advertisements. The Code is as follows: Save the following code as an htm
When you click an image (image or table element) on the left of the table and move it to the center of the table:
Reference content is as follows:
The file is referenced as follows:
Reference content is as follows:
Xp style menu Effect
Reference
There are two major substring and substr functions in javascript For string truncation. Next I will introduce the usage of the two string interceptions respectively. If you need to know about them, refer.
I. substring
Substring requires at least one
In js, if you want to achieve the simplest copy content, you can click the button to copy the content, we will use window. clipboardData. setData (\ "Text \", \ 'contains www. bKjia. c0m \ '); below I will summarize various replication effect codes.
This article recommends a good floating page advertisement to all of you. The Calling method is simple. You only need to create a div on the page and specify the id, then you can use js var ad1 = new AdMove ('gg1'); ad1.Run.
The Code is as
This article will introduce you to the new Code of the TreeView in javascript. If you need to know about it, you can refer to it.
Example 1
The Code is as follows:
Copy code
Function public_GetParentByTagName (element,
This article describes how to assign the content in the kindeditor editor to the textarea method when submitting a form through Ajax. For more information, see.
KindEditor cannot get the textarea text box value in Firefox or other browsers.
First,
Sometimes we can see that some websites can record the access time when you enter the website and leave the website. Below I will use js to write a few simple methods, for your reference.
Instance 1
The Code is as follows:
Copy code
We often need to look for some characters in the string or some content in html. Next I will introduce how to use the js indexOf method, according to the syntax of the indexOf method, stringObject. indexOf (the string to be searched, the position
When it comes to webpage incompatibility in various browsers, we usually handle the problem by judging the browser and then writing different JS or CSS styles, below are some common browser judgment js:
Windows operating system browser series:
IE
There are many methods to search for characters in js. One is to search for a specific string and return a string, and the other is to find the position of the string. I will share with you their implementation methods.
Searches for a specific
The cross-origin issue has always been a tangled issue. Next I will summarize the principles and Solutions of ajax cross-origin access and JQuery cross-origin. I hope this method will help you.
Cross-origin of JSThe problem is that many programmers
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