Tag Archives: Javascript

Coffeescript versus Javascript example for FUN

Coffeescript: window.someList = [1, 2, 3, 4, 5] addOne = (item) -> 1 + item window.runThings = () -> addOne item for item in someList Coffeescript compiled to JavaScript: (function() { var addOne; window.someList = [1, 2, 3, 4, 5]; addOne = function(item) { return 1 + item; }; window.runThings = function() { var item, [...]

Leave a comment Continue Reading →

jQuery Validator: Build Rules and Messages Dynamically

Ok so here’s your typical code for the jQuery Validator: jQuery(ELEMENT_FORM).validate({ errorLabelContainer: ELEMENT_ERROR_DIV, wrapper: ‘div’, rules: { textboxEmailAddress: { required: true, email: true } }, messages: { textboxEmailAddress: { required: ERROR_EMAIL_ADDRESS_REQUIRED } }, …. As you can see, the elements like “textboxEmailAddress” are hard coded in there which means if that name changes in the [...]

Leave a comment Continue Reading →

Child IFrame Page Interacting with Parent Page… Yeah I went there.

Example here. File this under “Why?” but I wanted to see if a child could talk to a parent and then receive information back from the parent to update itself with. As usual, my lack of intelligent wording probably has you scratching your head… if you do that. Personally I don’t get that expression as [...]

Leave a comment Continue Reading →

jQuery Validation – How to Use to Get Rid Of Even The Toughest Stains

So you want to use jQuery validation, huh? What is it? Something that was added to the holy jquery site and is an easy way to validate input from users. Now this should in no way take over for server side validation, but it helps to at least catch a few things without having to [...]

5 Comments Continue Reading →

jQuery: Add a Pop Up Div to a Link Dynamically

So as an exercise to learn more about jQuery, I decided to redo this little gem using jQuery. Have to say though only technically XHTML compliant, it worked out much better and with less code. So the idea is to have something really easy for non programmers (You know, lesser people) to be able to [...]

Leave a comment Continue Reading →