Found some cool glow effects. Couldn’t actually get them to work in my context, but it’s the thought that counts.
Tag Archives: jquery
Get element or tag name with jQuery
To get the element/tag name with jQuery:
$( '.selector' ).get( 0 ).tagName
jQuery htmlspecialchars equivalent to encode text as HTML
Found this which said:
$('<div/>').text('This is fun & stuff').html();
jQuery document ready
I’m always forgetting the syntax for the jQuery ‘document ready’ event. Which is an embarrassment because it’s so simple:
$( document ).ready( handler ) $().ready( handler ) (this is not recommended) $( handler )
I used to use the $( document ).ready( handler ) syntax, but starting today I use the $( handler ) syntax.
jQuery Validation Plugin
Using the jQuery Validation Plugin to validate my web forms… handy!
Preserving whitespace in jQuery .val()
Found this article today which had a method for preserving white space in jQuery’s .val() function.
$.valHooks.textarea = { get: function( elem ) { return elem.value.replace( /\r?\n/g, "\r\n" ); }};
Cloning a JavaScript object with jQuery
Today I heard from John Resig on StackOverflow about how to clone objects using jQuery:
// Shallow copy var newObject = jQuery.extend({}, oldObject); // Deep copy var newObject = jQuery.extend(true, {}, oldObject);
jQuery Templating Plugin
Today I learned about the jQuery Templating Plugin. Looks like something I’ll want to learn about!
jQuery.browser
I used the jQuery.browser interface for the first time today to put in an IE hack.
CSS drop down menus
Doing some research into CSS based drop down menus. Found 25 Scripts for Dropdown Navigation Menus. The ones I like the most are All Levels Navigational Menu and particularly jQuery Multi Level CSS Menu #1.