Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Thursday February 8 2018 - 06:02:20

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: Select all

now = new Date();
today = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear();
aI("text=Item1;url=/somedir/somepage.asp?query1=" + today + ";");

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.

Poster: zorigo
Dated: Thursday November 6 2003 - 18:00:50 GMT

That worked perfectly! Thanks Dave!

Poster: Hergio
Dated: Friday November 7 2003 - 3:34:33 GMT

Hot dang! I think that brings my total of working scripts to like 2, maybe 3! Yahoo! :lol: Glad it worked! As I said, I didnt test it makes it more interesting to see what you say afterwards! Best of luck with the Milonic DHTML Menu!!