In IE, A fireEvent method is provided, which, as its name implies, triggers an event. At the beginning, I thought it would be the same as using onclick () in normal times. I did not expect to find it when I was writing a javascript getting started
IE has many easy-to-use methods and is later copied by other browsers, such as the contains method. If element A contains Element B, true is returned; otherwise, false is returned. The only thing that does not support this method is the opposite of
Html2ja: parses the html target element into a JavaScript array literal. The values of each element are tagName, className, id, and other CSS selector combinations;
ShowJa: indent the array generated by html2ja to be formatted and displayed;
Lateral
1. 'null' is null or not an object:
Add the defer = true attribute to it,
That is:
Defer is used to execute the script after the file is loaded, so that the object cannot be found.
2. document. getElementById is null
Cause: var titab =
On the WordPress blog, the total number of messages for each message recipient is displayed. The effect is as follows:
The method is simple. Add the following code to the funtions. php file:
Function commentCountAuthor () {$ oneText = 'one
Today, I just need to judge that the iframe loading is complete. I just found out that the method for this article is perfect.
Var iframe = document. createElement ("iframe ");
Iframe. src = "http://www.bkjia.com ";
If (! /* @ Cc_on! @ */0) {// if
Writing a Javascript framework by yourself is a task that is decided by the last semester. With the rise of Ajax, websites are increasingly demanding Javascript, and Javascript itself has many defects and deficiencies, which need to be improved
Recently I made a project and used a lot of ajax. There was no cache problem in firefox, but there was a serious ajax cache in IE testing. The data was always lagging behind and I checked some information, I sorted out the Ajax cache solution.
1.
Parameters for js display layer and js hidden layer Functions
/*======================================Function: display or hide LayerShowDiv (divId_array, showLocality_array)Parameter description:DivId_array all layer IDs to be operated, separated
DOM Traversal
Searching for elements based on ID, element type, and class name is very useful, but what if you want to find elements based on their location in the DOM tree? In other words, you have a given element. You want to find its parent
In the afternoon, I want to create a Javascript script that follows the mouse. I found that browser compatibility is really annoying, and there is also a problem with the position of the scroll bar.
Fortunately, everything is available on the
JavaScript provides three explicit type conversion functions: eval (), parseInt (), and parseFloat ().Eval () function: converts a string expression to a numeric value. For example, the result of the statement total = eval ("432.1*10") is total = 432
Two custom js functions that implement mutual conversion between strings and arrays hope to be useful to you:
Copy to ClipboardReference: [www.bkjia.com] 1 function StringToArray (str, substr ){
2
3/* function: Splits a string into an Array Based on
Today, I encountered a Chinese Ajax garbled problem in one day. There are two types of Ajax garbled issues:
1. Chinese characters output by JavaScript are garbled,
For example: alert ("Chinese Garbled text test ");
The solution is relatively
// Create a new user object and accept an object with many attributes as a parameterFunction User (properties){// Traverse all attributes of the object and ensure that its scope is correctFor (var I in properties ){(Function (which ){Var p = I;//
It mainly tests the actual processing of the JS engine performance of the array push () method and the directly adding method. The program code is simple and easy to explain. Note: The number of cycles must be large enough.
Copy to
In the Asp.net background code, it is very easy to obtain the URL parameter. You can use Request. QueryString ["paramName. Sometimes I want to get URL parameters in Javascript, but I did not find them in the built-in Javascript method, so I wrote a
The presentation layer of the project uses MVC + Extjs. During the development process, once the page is not displayed normally, the first one that needs to be checked is always "does Action output correct Json ?". Because developers perform this
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