Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:58
Current date in URL?
Poster: zorigo
Dated: Wednesday November 5 2003 - 15:23:17 GMT
is there a way to include the current date in a URL in a menu? I can't seem to get it to work correctly
Here is my code:
aI("text=My Appointments;url=Calendar.asp?WeekID="Document.Write(now)";");
The date format should be mm/dd/yyyy
Poster: Hergio
Dated: Wednesday November 5 2003 - 20:54:18 GMT
Code:
<SCRIPT>
now = new Date();
today = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear();
....
....
aI("text=Item1;url=/somedir/somepage.asp?query1=" + today + ";");
....
</SCRIPT>
now = new Date();
today = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear();
....
....
aI("text=Item1;url=/somedir/somepage.asp?query1=" + today + ";");
....
</SCRIPT>
Haven't gotten a chance to test this but this is the general direction I would take. The menu item definition is essentially just a string, so you can start and stop it while inside the aI so when you get the query string part, you stop the string, concatinate it with the today-string and then concatinate that with the rest of the menu stuff and close the aI.