Recent Notes

Displaying keyword search results 1 - 6
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 October 21, 2010 19:48:36    Last update: October 21, 2010 19:50:43
Use the in operator to enumerate over an object's properties: Use the in operator to list all properties of an object Call the hasOwnProperty function to determine if the property is a direct attribute of the current object, i.e., not some attribute defined somewhere up the prototype chain. Test code (copy and paste to the JavaScript Executor ): function BaseClass() { this.p1 = 'parent.p1... Note that intrinsic attributes such as constructor , prototype are not listed by the in operator.
Created by Dr. Xi on January 29, 2009 21:33:44    Last update: January 30, 2009 17:43:33
You can use applet , object , or embed tags to embed an applet in your HTML page. However, The applet tag is interpreted by both IE and Mozilla family of browsers. The applet tag won't automatically download a JRE if the Java Plug-in isn't already installed. The object tag works only for IE The embed tag works only for Mozilla family of browsers, i.e., Firefox. Use applet tag: <applet code="MyApplet.class" width="200" ... Use object tag: <!-- latest JRE --> <OBJECT classid="clsid:... Use embed tag: <!-- highest JRE that supports MIME type ... Mixed object and embed tag: <object classid="clsid:8AD9C840-044E-11D1-B3E9... You need to use a different name for the Mozilla embed tag and use that name to refer to the applet...
Created by Dr. Xi on January 30, 2009 16:57:12    Last update: January 30, 2009 17:25:36
The scriptable attribute defaults to false . However, even when you set it to true , there is a time delay between when the applet is loaded and when it becomes scriptable . The following code may fail: <html><body> <object classid="clsid:8AD9C840-04... You need to wrap the JavaScript like this: <script language="JavaScript" type="text/javascrip...
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"...
Created by Dr. Xi on August 10, 2007 20:43:10    Last update: August 10, 2007 20:43:10
IE and firefox both support client side XSLT. This can be done by inserting an xml-stylesheet into the XML file, which would trigger the browser to apply the XSL to the XML document and generate a transformed page: <?xml version="1.0" encoding="utf-8" ?> <?... Or, it can be done more dynamically with client side JavaScript. However, IE and FF offer different APIs for XSLT. Below is my attempt to bridge the differences. It's been tested to work for IE 7.0, FF 2.0 and Opera 9.0.2. function XSLT(url) { var xslt = false; ... The following HTML page shows how to use it: <HTML> <HEAD> <SCRIPT language="JavaS...