Internet Explorer (IE) javascript error using jquery

I was receiving an error in IE (”Object doesn’t support this property or method”) from javascript that was working flawlessly in Firefox and Chrome.  It drove me crazy, as I did web searches, and debugging to figure out the cause of this.

I probably spent a full hour tracking this down, asking for help on Twitter, etc…  Before anyone had the chance to respond, I figured it out.  IE Sucks….  had to be the answer.

Actually, I didn’t “Declare” a couple of my variables ahead of time.

handOrientation = $(’input[@name=handOrientation]:checked’).val();  //gives the above error

var handOrientation = $(’input[@name=handOrientation]:checked’).val();  // does not

var handOrientation = ”;
handOrientation = $(’input[@name=handOrientation]:checked’).val();  // This also works.

Sometimes loose standards are nice, other times they are a pain (cross browser support, being the biggest pain).

 

Leave a comment

You must be logged in to post a comment.

 
This site hosted by bowlingball.com - Find the best deals on Bowling Balls, Bowling Bags, Bowling Shoes, and Bowling Accessories.