Remove all images from JQuery UI CSS

/* remove all default background images from jquery ui */ .ui-icon,.ui-widget-content .ui-icon, .ui-state-active .ui-icon, .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active, .ui-state-default .ui-icon, .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default, .ui-state-error .ui-icon,.ui-state-error-text .ui-icon, .ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error, .ui-state-highlight .ui-icon, .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight, .ui-state-hover .ui-icon,.ui-state-focus .ui-icon, .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus, .ui-widget-content, .ui-widget-header, .ui-widget-header .ui-icon, .ui-widget-overlay, .ui-widget-shadow { background-image: none; }

Quick Browser Detection One Liners

// You can expand this out in any line below // but it makes things much more readable var ua = navigator.userAgent.toString().toLowerCase(); //Browsers var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/ var IE7 = (document.all && !window.opera && window.XMLHttpRequest && ua.indexOf(‘trident/4.0’) == -1) ? true : false; var IE8 = (ua.indexOf(‘trident/4.0’) != -1);… Continue reading Quick Browser Detection One Liners

Published
Categorized as Javascript

IE8 select element change event not firing with the keyboard

Change events on select elements don’t fire in IE8 when the user confirms the selection with the enter key until the user clicks elsewhere. If your users are waiting on something in particular to happen after updating the select this is a bit of a problem. Here’s my solution: // jQuery syntax for ease of… Continue reading IE8 select element change event not firing with the keyboard

Published
Categorized as Javascript

Debugging Javascript with Console

A quick review. Console.log() //how to print a log statement console.log(‘That thing you expected to happen is now happening!’); //how to break production sites in internet explorer console.log(‘anything’); //how to log safer function l(str){if(window.console&&console.log){console.log(str);}} l(‘I can forget this in my code base without breaking anything!’); Console.trace() //how to figure out what’s calling what console.trace(); //console.trace… Continue reading Debugging Javascript with Console