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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.