Notes by James
Displaying keyword search results 1 - 10
Created by James on April 25, 2012 08:38:05
Last update: April 25, 2012 08:38:05
With no parameters, the .toggle() method simply toggles the visibility of elements. Example:
$(function() {
$('body').click(function() {
...
Created by James on February 02, 2012 09:31:03
Last update: February 02, 2012 09:31:03
This is an example that adds a validation rule to jQuery validation:
// add a custom method
$.validator.addMethod("m...
Created by James on March 11, 2011 08:53:31
Last update: January 30, 2012 09:33:56
Both delegate and live allow you to bind event handlers to elements created in the future, but there are some differences: For .delegate , the event bubbles up to the element on which it is called. For .live , the event bubbles up to the root of the DOM tree, or, as of jQuery 1.4, optionally stop at a DOM element context. DOM traversal methods are not supported for finding elements to send to .live() . Rather, the .live() method should always be called directly after a selector. The opposite of .live is .die . The opposite of .delegate is .undelegate . Note: As of jQuery 1.7, the .live() method is deprecated . Use .on() to attach event handlers. Users of older versions of jQuery...
Created by James on January 16, 2012 10:05:10
Last update: January 16, 2012 10:06:13
There are two ways to get the submit button:
Use the :submit selector (note the space between the form name and :submit ):
$('#the-form-id :submit')
Use attribute selector (also, space between form id and attribute selector):
$('#the-form-id [type="submit"] ')
// or
$(...
jQuery recommends the latter if you are concerned about performance:
Because :submit is a jQuery extension and not part of the CSS specification, queries using :submit cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use [type="submit"] instead.
Created by James on November 27, 2011 12:43:24
Last update: November 27, 2011 12:59:01
An easy to digest stylesheet example for XSLT for Atom. Simply list entry titles and summary:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
To show the first 3 items in atom feed:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
Created by James on November 23, 2011 13:57:51
Last update: November 23, 2011 13:57:51
An easy to digest stylesheet example for XSLT for RSS. Simply list item titles descriptions:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
URL for Google news feed: http://news.google.com/news?ned=us&topic=h&output=rss
Created by James on October 25, 2011 19:44:30
Last update: October 25, 2011 19:45:40
jQuery automatically maps HTML5 custom data attributes to data storage associated with the data() method. Here's an example:
<html>
<head>
<script type="text/javascript"...
Created by James on March 07, 2011 15:49:11
Last update: March 07, 2011 15:49:11
The JavaScript string match method matches the string against a regular expression and returns the matches.
// returns ['av']
'The JavaScript string ma...
Created by James on October 11, 2010 19:01:28
Last update: January 11, 2011 20:38:56
Test page (click the "new window" icon to see the transition):
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Created by James on October 11, 2010 18:14:41
Last update: January 11, 2011 20:36:01
Test page:
<!DOCTYPE html>
<html>
<head>
<title>jQu...
Documentation:
UI/Effects - jQuery JavaScript Library
Effects - jQueryAPI