Functions for reading, writing, and deleting Javascript cookies

Copy codeThe Code is as follows:Function getCookie (name){Var start = document. cookie. indexOf (name + "= ");Var len = start + name. length + 1;If ((! Start) & (name! = Document. cookie. substring (0, name. length ))){Return null;}If (start =-1)

JavaScript DOM learning Chapter 3 content table

If you want to do the same, you also need my getElementByTagNames () function.Copy codeThe Code is as follows:Function createTOC (){Var y = document. createElement ('div ');Y. id = 'innertoc ';Var a = y. appendChild (document. createElement ('span ')

Jquery obtains the two functions of the current page height and width.

Copy codeThe Code is as follows:// ======= Jquery framework to be referenced ====== //// Return the current page heightFunction pageHeight (){If ($. browser. msie ){Return document. compatMode = "CSS1Compat "? Document.doc umentElement. clientHeight:

Search Method for url parsing using javascript

Copy codeThe Code is as follows:Function searchParse (){Var resultObj = {};Var search = window. location. search;If (search & search. length> 1 ){Var search = search. substring (1 );Var items = search. split ('&');For (var index = 0; index If (!

JQuery basic code for changing CSS styles

Either of them accepts two input parameters: style attributes and style values, separated by commas. For example, to change the link color, we can use the following code:Copy codeThe Code is as follows:$ ("# 61dh a" ).css ('color', '#123456 ');//

10 confusing things in JavaScript

1. It is named in Java, but it is not Java It was initially called Mocha, and then renamed LiveScript, and finally named JavaScript. According to the historical records, the name of Java is related to the cooperation between Netscape and Sun and

JQuery ctrl + Enter shift + Enter implementation code

The which of the event can be used to find the key code.However, when there is a combination of keys, you need to pay attention to it.For example, the ctrl + enter key uses e. ctrlKey, but the enter key code is not always 13.In ff, determine that

Common jquery operations

Operation drop-down listAdd Option List$ (This). get (0). options. add (new Option (text, value ));Clear list$ (This). get (0). options. length = 0;Option for deleting a specified index$ (This). get (0). remove (index );Set the value of the selected

Classic Summary of common Jquery Methods

1. Reference of page elementsThe $ () referenced element of jquery includes methods such as id, class, element name, element hierarchy, dom or xpath conditions, and the returned object is a jquery object (set object ), you cannot directly call

Js simulation to implement simple functional code similar to hashtable in c #

In c #, we can easily implement this function by using hashtable or dictionary to obtain value based on the key feature. As a matter of fact, js can also implement features similar to hashtable. Below is a summary of the implementation methods used

Problems in obtaining form elements in javascript

I. Test Environment Browser: IE6 +, FF 3.5.5, Opera 10, Chrome 4.0.249, Safari 4.0.3Ii. ExampleCopy codeThe Code is as follows: 3. solution (the method I think of is to change the acquisition method, based on YUI) Copy codeThe Code is as follows:

Former Taobao front-end development engineer a dang's PPT contains JS technical concepts

The code for the 7th PPT files uses JS to set CSS, which has nothing to do with "different browsers parse DOM" and is CSS compatibility! In addition, setting styles directly with JS is a technical mistake!The code for the 9th PPT files is programmed

Javascript options attribute set operation code

Copy codeThe Code is as follows: first option second option third option your browser can't handle this script Use the following code to access the options in the drop-down list:Copy codeThe Code is as follows:// Obtain the option objectDocument.

JQuery DOM operations change pages based on commands

Er, it looks like an advertisement, huh? Haha, but it does. jQuery provides us with a wide range of DOM operation methods to make these complex DOM operations easy.It seems that it has been a long time since I wrote jQuery notes. It is also

Scroll bar color hiding scroll bar and double-click Page Auto-scrolling display code

Install the "scroll bar color" plug-in downloaded from the USB flash drive,After DW is installed, how can I normally apply this special effect plug-in?A: Open DW,1. Create a page -- code -- delete all the code above !2. Navigate to and click DW

Js Study Notes (3)

An object-oriented language provides developers with four basic capabilities:(1) Encapsulation-ability to store relevant information (regardless of data or methods) in objects.(2) aggregation-the ability to store one object in another.(3)

Use jQuery to obtain the code collection of radio/checkbox group values

Copy codeThe Code is as follows:$ ("Document"). ready (function (){$ ("# Btn1"). click (function (){$ ("[Name = 'checkbox']"). attr ("checked", 'true'); // select all})$ ("# Btn2"). click (function (){$ ("[Name = 'checkbox']"). removeAttr ("checked")

Move the keyboard up/down key to select the js Code of the table row

// This is the table to be operated on: This is the first line This is the second line This is the third row This is the fourth row // This is the code used to operate the table. [Ctrl + A select all Note: If you need to introduce

Javascript clears the value of an element in the form.

The following uses case type = "text" as an example:Copy codeThe Code is as follows: By calling the Refresh method of jsMethod 1Copy codeThe Code is as follows:Function Refresh (){Var v = document. forms [0]. elements;For (var I = 0; I {If (v [I].

Use Jquery to implement editable tables and submit them to the server to modify data

Below is the js Code: Copy codeThe Code is as follows:$ (Function () {// equivalent to adding an onload event to the body tag of the page$ (". Caname"). click (function () {// Add the click function to the tag with the caname class on the pageVar

Total Pages: 5378 1 .... 2497 2498 2499 2500 2501 .... 5378 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.