Parse an unknown JSON with Jquery

Posted in IT StuffTagged , , ,

Sometime it happens to receive a JSON string than need to be visualized without knowing the structure. Suppose we have an HTML table: <tbody id="reportTable"> </tbody><tbody id="reportTable"> </tbody> To populate this table with jQuery it’s possible to use this simple code: var rows = ${reportRows}; var html = $.each(rows, function(key, value){   $("#reportTable").append("<tr>");   $.each(value,….

Apply jQuery datepicker to multiple instances

Posted in IT StuffTagged , , ,

To add multiple instance of jQuery datepicker (or timepicker), it is possible to use class instead of the ID to initialize the widget in particular when the form is generated from the backend and the exact number of field is not known. The html code will be: <input type="text" class="datepicker" id="date1" /> <input type="text" class="datepicker"….

Change Eclipse settings to ignore jquery errors on a specific file

Posted in IT StuffTagged , ,

In my dynamic web project in eclipse, I have jQuery in my js source folder. For some reason, Eclipse is not handling it correctly and interpreting many lines as errors in the standard jQuery file (even though I have the javascript development tools installed). I have found that I can leave the JavaScript Validator enable….