Recent Notes

Displaying keyword search results 1 - 9
Created by James on November 09, 2013 20:54:03    Last update: November 09, 2013 20:54:03
This page draws an interactive parabola on HTML5 Canvas. <!DOCTYPE HTML> <html> <head> <...
Created by Fang on January 16, 2012 19:32:20    Last update: January 16, 2012 19:32:54
You can submit a form via Ajax by the jQuery Form Plugin . There are two main methods: ajaxForm : prepares a form for Ajax submit. Example: $('#myFormId').ajaxForm({ target: ... When the form is submitted, it is sent via Ajax. ajaxSubmit : submit a form via Ajax. Example: $('#myForm2').submit(function() { // i... jQuery Form Plugin is not in the core jQuery API, so you have to include an additional JS file: <head> <script type="text/javascript" ...
Created by James on January 10, 2011 12:35:53    Last update: November 04, 2011 19:28:03
The events mouseover and mouseout are fired when the mouse enters/leaves the element where the event handlers are registered, and any nested elements which do not handle these events (because of event bubbling ). The events mouseenter and mouseleave are fired only when the mouse enters/leaves the specified element. Nested elements do not come into play. This following is a test page. You need Firebug to view the console output. Or use the JavaScript Executor bookmarklet. If none of these are available, an alert will popup (but you won't be able to fully test with alert.). <!DOCTYPE HTML> <html> <head> <title>jQu... For the above test page, when you move the mouse through both the outer and inner areas of the mouseover/mouseout rectangle, the output is...
Created by James on March 11, 2011 09:28:31    Last update: March 11, 2011 09:28:31
To delegate an event to all but the first child, the selector :not(:first) does not work, but :gt(0) works. <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on March 11, 2011 09:03:21    Last update: March 11, 2011 09:03:21
Use the :first selector to delegate an event to the first element of a selection. <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on March 02, 2011 12:29:38    Last update: March 11, 2011 08:42:50
jQuery event delegation allows you to bind event handlers to elements not yet created, under these conditions: The DOM element must nest inside the element to which the event is delegated to The inner element must not stop event bubbling The opposite of delegate is undelegate . <!DOCTYPE HTML> <html> <head> <title>jQu...
Created by James on September 28, 2010 18:57:58    Last update: January 11, 2011 20:35:02
Test page to demo that preventDefault works perfectly for a text input but fails for select , even though the event is cancelable: <!DOCTYPE html> <html> <head> <title>Pre...
Created by Dr. Xi on August 21, 2007 21:25:58    Last update: January 10, 2011 22:19:09
You can grab some animated icons here: http://mentalized.net/activity-indicators/ . And here's some code to demonstrate how to use such an icon. <html> <head> <script language="JavaScript"... However, if you use Ajax and send a synchronous request, the icon won't show up at all, i.e., the following code doesn't work: function eventHandler() { startBusy(); ... This works: function eventHandler() { startBusy(); ...
Created by James on June 22, 2010 19:40:53    Last update: June 22, 2010 19:52:53
Use jQuery to submit a form by clicking a button not associated with the form. The jQuery submit method can also be used to associate an event handler on the form. <!DOCTYPE html> <html> <head> <title>jQu... To submit the first form on the page: $('form:first').submit();