galvin Posted January 2, 2011 Share Posted January 2, 2011 Is there anything wrong with the syntax below? This is some Jquery for a datepicker from the JQuery website (http://jqueryui.com/demos/) and it works fine in most browsers, but does not work in IE7. It does work in IE8. The site says the datepicker has been tested to work in IE6 and above. I made some changes, so something I did must be wrong. Someone said IE can choke on trailing commas, so I'm not sure if that comma after "mm/dd/yy" is bad or not. Anyone see anything glaringly wrong about my syntax? <script> $(function() { $( "#datepicker" ).datepicker({ dateFormat: 'mm/dd/yy', }); var chosendate = '<?php echo $_SESSION['thedate']; ?>'; $('#datepicker').datepicker("setDate", chosendate); }); </script> Quote Link to comment https://forums.phpfreaks.com/topic/223170-jquery-syntax-causing-issues-in-ie7/ Share on other sites More sharing options...
trq Posted January 2, 2011 Share Posted January 2, 2011 Someone said IE can choke on trailing commas, so I'm not sure if that comma after "mm/dd/yy" is bad or not. Anyone see anything glaringly wrong about my syntax? Yes, that comma after the 'mm/dd/yy' is a syntax error. Most browsers (stupidly IMO) will let this slide, IE on most occasions (rightfully so) won't. So yeah, this is one occasion where it is actually IE doing the right thing and all other browsers doing it wrong. Quote Link to comment https://forums.phpfreaks.com/topic/223170-jquery-syntax-causing-issues-in-ie7/#findComment-1153738 Share on other sites More sharing options...
haku Posted January 2, 2011 Share Posted January 2, 2011 Thorpe is entirely correct. As a side point - you already had a clue as to what the problem was, why didn't you just try it out? It would be a lot faster than waiting for an answer here. Quote Link to comment https://forums.phpfreaks.com/topic/223170-jquery-syntax-causing-issues-in-ie7/#findComment-1153744 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.