Category Archives: Javascript

Javascript Compression

http://www.codeandcoffee.com/2006/10/02/compress-your-javascript/ Online version of JSMin. I’ll give you an example: prototype.js (version 1.6.0.2) _ before: 124K _ after: 92K Nothing very special but it could help. Anyway I think it’s the best you can get with just this type of … Continue reading

Posted in Javascript, Web Service | Leave a comment

Conditional Form Submit (With or Without AJAX)

Without AJAX: <script> function validateForm() { if (ok) { // everything’s OK, we can submit the form return true; } else { return false; } } </script> <form onSubmit=”return validateForm()”> <input type=”submit” value=”Submit”> </form> /////////////////////////////////////////////////////// With AJAX: If submitting the … Continue reading

Posted in AJAX, HTML / CSS, Javascript | Leave a comment

Prototype – Keyboard Shortcuts

Event.observe(window, ‘load’, function() { Event.observe(document, ‘keypress’, function(e){ var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code); alert(‘Character was ‘ + character); }); });

Posted in Prototype / Scriptaculous | Leave a comment

Howto Dynamically Insert Javascript And CSS

Howto_Dynamically_Insert_Javascript_And_CSS.html

Posted in HTML / CSS, Javascript | Leave a comment

Javascript: Very Cool Date Time Picker

JsCalendar http://www.dynarch.com/demos/jscalendar/

Posted in Javascript | Leave a comment

Javascript Get The Checked Values For Radio Buttons and Checkbox

Radio button: HTML: <input type=”radio” id=”myradio” name=”myradio”> Javascript: var myradio = document.getElementsByName(‘myradio’); var choice = getRadioCheckedValue(myradio); // Given a radio button obj, return the selected value function getRadioCheckedValue(radioObj) { if(!radioObj) return “”; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) … Continue reading

Posted in HTML / CSS, Javascript | Leave a comment

Javascript Calendar

http://www.mattkruse.com/ Calendar Popup JS Calendar

Posted in Javascript | Leave a comment

Javascipt: replace

The replace method replaces just the first occurrence. In order to replace all the occurrences, you must use a regular expression (enclosed by slashes) followed by g (= general). Careful: don’t use quotation marks for enclosing the regular expression. Some … Continue reading

Posted in Javascript | Leave a comment

Eclipse and Javascript

Aptana for debugging purpose in Eclipse.

Posted in Free Software, Javascript | Tagged | Leave a comment

Framework Javascript

The best are: Prototype one of the most commonly used but maybe a bit heavy JQuery light-weight and with a lot of plugins YUI developed Yahoo. It’s not about shiny visual effects but to bring desktop-usability on your Web Applications. … Continue reading

Posted in Javascript | Leave a comment