var today = new Date(); is giving me this error: Microsoft JScript runtime error: Object expected
-
I dont know why this statement is giving me error . I have written this in a Javascript file that is attached to my project. I am trying to declare a variable containing todays date. Can Anyone help please?
are you certain this line has the error ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
are you certain this line has the error ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Absolutely, I am using Visual studio 2008. I tried following code in studio 2005 now but i am getting same error. Not sure why it is occuring? Really strange.. Is there any other way to get todays date in some variable? function Test() { var today = new Date(); alert(today); } <asp:Button ID="Button1" runat="server" OnClientClick="Test();" Text="Button" /><br />
-
I dont know why this statement is giving me error . I have written this in a Javascript file that is attached to my project. I am trying to declare a variable containing todays date. Can Anyone help please?
-
I used the below code and it worked fine for me
<script type="text/javascript">
var today = new Date();
alert(today);
</script>Regards Aman Bhullar www.arlivesupport.com[^]
It should work because it is a correct code. But what can be the reason for it to be failing? Everytime i try to declare any Date variable it gives me : Microsoft JScript runtime error: Object expected I have tried to reboot my pc still it doesnt work.. Is my Jscript engine corrupted or something?
-
I dont know why this statement is giving me error . I have written this in a Javascript file that is attached to my project. I am trying to declare a variable containing todays date. Can Anyone help please?
I think your browser got whacked somehow. Reinstalling the browser will help you. Date is a prototype should be declared within the library of browser. :doh: :doh: It is working for all of us. Sorry cant help you. :sigh: :sigh:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
I think your browser got whacked somehow. Reinstalling the browser will help you. Date is a prototype should be declared within the library of browser. :doh: :doh: It is working for all of us. Sorry cant help you. :sigh: :sigh:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.