‘jQuery’ Archive

Bug with Broken Ordered list in IE9 June 11, 2011 9 Comments

Recently I’ve been working with ordered lists. And found strange behavior in IE9 when one ordered list is hiding and new one is showing – instead of usual order 1,2,3.. it showed all zeros. And it actually doesn’t matter what list style type you choose – decimal, lower alpha or other. Let me show you […]


The array declaration difference between Firefox and IE JavaScript interpreter May 21, 2010 2 Comments

Found interesting difference in array declaration between FF and IE. For example, if leave comma (,) after all elements in array there will be different size of array as a result: var arr = [1,2,3,]; document.write(arr.length); As a result in Firefox and Safari it will write “3” but in IE it will be “4”.  


jQuery UI: Datepicker for birth date input July 11, 2009 11 Comments

I decided to use jQuery UI Datepicker control for one of project and faced with the some strange behavior. At first, I decided to find a way to select month and year quickly because switching months with previous button will unhappy every user. So I’ve added the following options: $(‘#datepicker’).datepicker({ changeMonth: true, changeYear: true }); […]


Open link in a new window in XHTML 1.0 Strict June 24, 2009 1 Comment

As you may notice using target=”_blank” breaks XHTML 1.0 Stric validation. And here you are a solution with jQuery: Add rel=”external” for links that you want to be opened in a new window Include the following jQuery script: $(function() { $(“a[rel*=’external’]”).click(function() { window.open($(this).attr(‘href’), ‘external’, ”); return false; }); }); But I agree that it’s annoying […]


jQuery tips and tricks: ‘Add more’ functionality in a table June 23, 2009 No Comments

Usually we have ‘Add more’ link on the forms. For example, on the project I’m working on right now there is registration form and user with Advanced package can create a few accounts. So we have ‘Add more’ link that should add one more row with Name, Email and Password for adding another account. Because […]


Focus element in ThickBox March 24, 2009 7 Comments

I faced with a problem focusing element in thickbox popup. I open login form using thickbox and want to take a focus on the first element of the form. Though the following code does look to be working: $(document).ready(function() { $(“input[name=’username’]”).focus(); }); But there is a little trick. If you make a small 100ms delay […]