// Use: $ ("selector "). inputonlynum (); enter only numbers (function ($) {$. FN. inputonlynum = function () {This. keypress (function (e) {If (E. which = 8 | E. keycode = 9) return true; // backspace & tab in FF var B =/^ [\ D \. -] $ /. test
The following four functions are part of them.
first, we need to add a browser detection Script: copy Code the code is as follows: /********************************** * Check the browser ********************************** */ var user =
CopyCode The Code is as follows: function click (E)
{
If (document. All)
{
If (event. Button = 1 | event. Button = 2 | event. Button = 3)
{
Oncontextmenu = 'Return false ';
}
}
If (document. layers)
{
If (E. Which = 3)
{
Oncontextmenu = 'Return
1. After viewing the source file, I was puzzled to find that this page does not contain the prize information. This determines
Code In another page. So it is assumed that the address is connected using the framework. The result is not found, but
[Jquery] jquery event processing BIND (type, [data], FN)Data, bind, jquery, Type
BIND (type,[Data], FN)Returned value: jqueryOverviewBind an event handler for a specific event of each matching element.The. BIND () method is
1. Block default event return false
2. By default, the system right-click menu oncontextmenu. to be compatible with all browsers, you must write document. oncontextmenu = function () {return false ;}
3. The mouse position of native Javascript is
Author: gnuhpcSource: http://www.cnblogs.com/gnuhpc/
1. This mode is relatively simple. Here is an example of a bank loan application process (This is not an example in the book.):
When applying for a loan, the Bank should check the customer's
The one I used in the previous project was also written by myself, but it was based on JQ. Recently, I saw that the JS question posted by Renren is similar to this one, so I used Native js to rewrite it again:
JS
(Function (WIN) {var tips = {'title':
As we all know, sizzle is jquery's royal selector engine and the DOM selector engine written by John resig, the author of jquery. The speed is claimed to be the highest in the industry. In addition, sizzle is an independent part and does not rely on
1. Collection class Object Problems In the existing Code, many collection class objects are used (), which is acceptable to IE and cannot be used by Firefox.Solution: use [] as the subscript operation. For example, change document. Forms ("formname")
Nowadays, Ajax is everywhere, and forms, as the focus, are naturally taken care.
In fact, we usually use jquery to submit forms asynchronously. Generally, $. Ajax is used in submit. For example:
$(function(){ $(‘#myForm‘).submit(function(
How to delete elements:
Remove all objects with specific values in a container:If the container is a vector, string, or deque, use erase-Remove.C. Erase (remove (C. Begin (), C. End (), 1963), C. End (); // deletes all 1963 If the container is
I used to write functions in IE, so I wrote some functions in Firefox. I spent a lot of time on Firefox and found some differences between Firefox and IE:
1. Firefox does not support innertext or why. Firefox supports innerhtml but does not
One bind method
Prototype: bind (type, [data], fn)
Purpose: bind an event processor function to a specific event of each matching element.
Returned value: Object
Parameter: type (String): Event type
Data (Object): [Optional] additional data Object
FTP is a File Transfer Protocol that supports two modes: Standard (Active) and Passive (PASV, passive mode ). The FTP client in Standard mode sends the PORT command to the FTP server. The client in Passive mode sends the PASV command to the FTP
Compared with the in operator, for in traverses the prototype chain during the attributes of the loop object. for in does not read non-enumeration attributes, such as The length attribute of an array. Summary when detecting whether an object has a
1. Get the width, border color and other css (not line) in the style table is mainly IE6-7 support currentStyle, standard browser support getComputedStyle;
Instance: encapsulation FunctionCopy codeThe Code is as follows: function getStyle (obj,
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.