Jump to content

Jquery syntax causing issues in IE7?


galvin

Recommended Posts

 

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>

 

Link to comment
https://forums.phpfreaks.com/topic/223170-jquery-syntax-causing-issues-in-ie7/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.