I had this problem too (I was passing a line from the code on the popup window to javascript on the opener). My solution was pretty simple.
in asp.net
<asp:Label ID="foo" runat="server"/>
in javascript
foo.Text = "5/5/2011";
in codebehind:
string runThis = "blahblah" + "'" + foo.Text + "';";
Without a single quotation mark surrounding the text, she spat out a decimal fraction (i.e., mathematical result 5/5/2011)
I assume that in your situation you could do
alert("'" + myDate + "'");
source share