Peng Zhang on December 14th, 2011

The Problem On a Sharepoint page, I am using jQuery to render a link using attr(‘onclick’,’somejavascriptcodehere’), and that link works in Firefox but not in IE. The Solution Use $(‘a#theid’).click() instead of $(‘a#theid’).attr(‘onclick’,’javascript:somejavascriptcodehere’). The Possible Cause IE can handle other tag attributes added or updated by jQuery, but just could not immediately add an event [...]

Continue reading about onclick not working in IE but works in Firefox

Peng Zhang on July 13th, 2011

Based on this article on setInterval’s syntax, setInterval should take either a reference to a function or a javascript code that will be evaluated – basically a string. For some reason, Firefox does not like the “string” version of the setInterval statement. Based on my testing, IE works with both the direct reference or code [...]

Continue reading about setInterval and Firefox

Peng Zhang on March 11th, 2011

Created a jQuery plugin for vertical and horizontal centering.

Continue reading about Created the First Ever jQuery Plugin Today

Peng Zhang on February 22nd, 2011

This problem would occur if setEffect() call is before the addItem() calls. The code below has the problem; 1 2 3 4 5 6 7 var dhxAccord = dhxLayout.cells("a").attachAccordion(); dhxAccord.setIconsPath("dhtmlx/imgs/"); dhxAccord.setEffect(true); dhxAccord.addItem("a1", "Resource Tracking"); dhxAccord.addItem("a2", "Video Tracking"); dhxAccord.addItem("a3", "Evaluation Tracking"); dhxAccord.openItem("a1"); On the other hand, this code does not have the probelm: 1 2 3 [...]

Continue reading about dhtmlXAccordion Does not Open or Close on Clicking

Peng Zhang on February 18th, 2011

Color Charting/Visualisation HighCharts JS grafico charting Visual Effects PaintBrush JS File Upload Other processing.js

Continue reading about JavaScript Libraries

Situation Forms set to use  the encoding “application/x-www-form-urlencoded” and the GET method will encode a space in input text into a “+” in the query string. In the form handler, none of the readily available decoding function can properly decode the “+” back to a space using javascript.  Neither “unescape” nor “decodeURIComponent” function returns the [...]

Continue reading about Problem UrlEncoding and UrlDecoding Space in Query String Values