You can use a simple XSL style sheet to convert XML data into HTML. With the continuous evolution of XML specifications, it seems necessary to meet the needs of everyone in the new version. Suppose there is an XML data that represents the content of
1. event. srcElement Problems
In IE, the event object has the srcElement attribute but does not have the target attribute;In Firefox, the even object has the target attribute but does not have the srcElement attribute.
We can solve this problem as
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
Today, I saw some common mouse events on a friend's website. Below I will sort out and keep a record, which will be useful in the future. If you need to know about it, you can refer to it.
General eventsDescription supported by event Browser
OnClick
This article will show you how to set default values for function parameters in Javascript. For more information, see
In php, I can write it like this.
The Code is as follows:
Copy code
Function abcccc ($ a = 1, $ B = 2
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
There are two common methods to use ajax in js: the original XMLHttpRequest method and the popular Jquery ajax method. I will introduce them here.
For Ajax, the core object is XMLHttpRequest. All Ajax operations cannot be separated from operations
In js, spaces and spaces are two different types of conditions. Spaces occupy one character space. Many programmers can directly submit a space if they enter a few spaces during judgment, to filter spaces in js, we only need to use replace for
When limiting the number input by users in js, our core code is to add the onKeyDown event in testarea, and then write a character judgment function to judge the field. value. the length is greater than the character length we set. If yes, substring
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
This article will introduce you to the program for redirecting to the specified element. This is a good transfer program. If you need to know about it, you will not be able to access it.
The Code is as follows:
Copy code
/***
In js, it is easy to directly use window to achieve page Jump. location. href can be implemented. If you want to perform a scheduled jump, you need to use the setTimeout Function to set a scheduled jump. I will summarize it for you.
The following is
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
The core statement for getting the value of the drop-down list using js is: document. getElementById (id). options [Objsel. selectedIndex]. value;, but jquery is simpler.
Js to get the value of the drop-down list
The Code is as follows:
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