Recent Notes

Displaying keyword search results 1 - 5
Created by James on April 24, 2012 13:50:05    Last update: April 24, 2012 13:50:05
The this object can be changed when calling a JavaScript function with func.call(theObject) . This is an example: <!DOCTYPE html> <html> <head> <title>jQu... The JavaScript console logs: [Global log] this is: [object Window] [log.cal...
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 September 03, 2010 15:52:12    Last update: January 11, 2011 20:22:40
Use the siblings function to find all siblings of the current jQuery object: $(this).siblings() which is equivalent to: $(this).parent().children().not(this) Or, use an optional selector to further limit the selection of siblings: $(this).siblings('li .hilighted') Test page: <!DOCTYPE html> <html> <head> <title>jQu...
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/mod_python.so ... Python script: import time, os from os.path import basename ...
Created by Dr. Xi on November 15, 2007 04:40:44    Last update: November 15, 2007 04:40:44
Here's some simple Ajax code. The Ajax response is delivered as XML with attributes and an array of data payloads contained in CDATA sections: <?xml version="1.0" encoding="utf-8"?> <ajax-re... And the JavaScript that does the Ajax magic: // ajax.js function ajaxGet(url, ajaxCallback) ... And the HTML test code: <html> <head> <script language="JavaScript"...