jack_p50
asked on
Updated since last visit
I saw 1 site that was topic What's updated since your last visit. How to do it (i think it's Javascript)
I think mouatts is right. It could be done by JavaScript, but server-side would be so much easier.
Martin
Martin
ASKER
That's very good, but how to do this?
Is this ok?
<HTML>
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
lastVisit = getCookie("Last visit");
if (lastVisit == null) lastVisit = 0;
today = new Date();
setCookie("Last visit", today.getTime());
descriptions = new Array();
dates = new Array();
// List all updates
// To get the integer that you should use, open up Netscape and write
// mocha:getCode()
addUpdate("Bug fixes", 914280388850)
addUpdate("Minor improvements", 914280529020)
// Function declarations
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit) {
s += "<B>" + new Date(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se arch);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf("; ", offset);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s ubstring(o ffset, end));
}
}
}
function addUpdate(description, date) {
descriptions[descriptions. length] = description;
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
// -->
</SCRIPT>
</BODY>
</HTML>
I can write a date format routine to get it look more "professional". Just tell me how you want it to look.
Martin
<HTML>
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
lastVisit = getCookie("Last visit");
if (lastVisit == null) lastVisit = 0;
today = new Date();
setCookie("Last visit", today.getTime());
descriptions = new Array();
dates = new Array();
// List all updates
// To get the integer that you should use, open up Netscape and write
// mocha:getCode()
addUpdate("Bug fixes", 914280388850)
addUpdate("Minor improvements", 914280529020)
// Function declarations
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit) {
s += "<B>" + new Date(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s
}
}
}
function addUpdate(description, date) {
descriptions[descriptions.
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
// -->
</SCRIPT>
</BODY>
</HTML>
I can write a date format routine to get it look more "professional". Just tell me how you want it to look.
Martin
ASKER
Ok, please do it and send as answer. Exactly I want :
1)User came to site and visit all updates
2)He comes again and visits "Since your last visit, was updated ....."(list of updates as you did).
3)Please, do such thing that if user wants, he can see all updates (i.e. some button "see all updates")
4)Big thanx ;)
1)User came to site and visit all updates
2)He comes again and visits "Since your last visit, was updated ....."(list of updates as you did).
3)Please, do such thing that if user wants, he can see all updates (i.e. some button "see all updates")
4)Big thanx ;)
I'm no good at date formats, but this is how I've made it: "Tuesday 22 Dec, 18:09" Let me know if it's wrong and I'll change it.
<HTML>
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
last = getCookie("Last visit");
if (last == null) last = "0";
lastVisit = parseInt(last);
lastVisit *= 1000;
today = new Date();
expdate = new Date();
expdate.setTime(expdate.ge tTime() + 30*24*60*60*1000);
setCookie("Last visit", today.getTime()/1000, expdate);
descriptions = new Array();
dates = new Array();
// List all updates
// To get the code that you should use, open up Netscape and write
// mocha:getCode()
// In the location field
addUpdate("Bug fixes", 914280388850);
addUpdate("Minor improvements", 914280529020);
addUpdate("Date formatting and allUpdates() function", 914342950000);
// Function declarations
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates.";
}
w = open('','','height=300,wid th=300,scr ollbars');
w.document.open();
w.document.write(code);
w.document.close();
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se arch);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf("; ", offset);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s ubstring(o ffset, end));
}
}
}
function addUpdate(description, date) {
descriptions[descriptions. length] = description;
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
function formatDate(date) {
d = new Date(date);
// hh:mm
h = d.getHours();
m = d.getMinutes();
time = ((h<10) ? "0"+h : h) + ":" + ((m<10) ? "0"+m : m);
// month
months = new Array(12);
months[0] = "Jan"; months[1] = "Feb"; months[2] = "Mar";
months[3] = "Apr"; months[4] = "May"; months[5] = "Jun";
months[6] = "Jul"; months[7] = "Aug"; months[8] = "Sep";
months[9] = "Oct"; months[10] = "Nov"; months[11] = "Dec";
month = months[d.getMonth()];
// weekday
days = new Array(7);
days[0] = "Sun"; days[1] = "Mon"; days[2] = "Tues"; days[3] = "Wednes";
days[4] = "Thurs"; days[5] = "Fri"; days[6] = "Satur";
weekday = days[d.getDay()] + "day";
return weekday + " " + d.getDate() + " " + month + ", " + time;
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
document.write('<FORM><INP UT TYPE="BUTTON" VALUE="All updates" onClick="allUpdates()"></F ORM>');
// -->
</SCRIPT>
</BODY>
</HTML>
Martin
<HTML>
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
last = getCookie("Last visit");
if (last == null) last = "0";
lastVisit = parseInt(last);
lastVisit *= 1000;
today = new Date();
expdate = new Date();
expdate.setTime(expdate.ge
setCookie("Last visit", today.getTime()/1000, expdate);
descriptions = new Array();
dates = new Array();
// List all updates
// To get the code that you should use, open up Netscape and write
// mocha:getCode()
// In the location field
addUpdate("Bug fixes", 914280388850);
addUpdate("Minor improvements", 914280529020);
addUpdate("Date formatting and allUpdates() function", 914342950000);
// Function declarations
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates.";
}
w = open('','','height=300,wid
w.document.open();
w.document.write(code);
w.document.close();
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s
}
}
}
function addUpdate(description, date) {
descriptions[descriptions.
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
function formatDate(date) {
d = new Date(date);
// hh:mm
h = d.getHours();
m = d.getMinutes();
time = ((h<10) ? "0"+h : h) + ":" + ((m<10) ? "0"+m : m);
// month
months = new Array(12);
months[0] = "Jan"; months[1] = "Feb"; months[2] = "Mar";
months[3] = "Apr"; months[4] = "May"; months[5] = "Jun";
months[6] = "Jul"; months[7] = "Aug"; months[8] = "Sep";
months[9] = "Oct"; months[10] = "Nov"; months[11] = "Dec";
month = months[d.getMonth()];
// weekday
days = new Array(7);
days[0] = "Sun"; days[1] = "Mon"; days[2] = "Tues"; days[3] = "Wednes";
days[4] = "Thurs"; days[5] = "Fri"; days[6] = "Satur";
weekday = days[d.getDay()] + "day";
return weekday + " " + d.getDate() + " " + month + ", " + time;
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
document.write('<FORM><INP
// -->
</SCRIPT>
</BODY>
</HTML>
Martin
ASKER
WoW!
Here are last questions :
1)Please do in so format : "22th of December, 1998 :
..............."
2)Please do when user presses all updates it reloads to current window.
3)Next time post it as answer
Thanx
Here are last questions :
1)Please do in so format : "22th of December, 1998 :
..............."
2)Please do when user presses all updates it reloads to current window.
3)Next time post it as answer
Thanx
ASKER
and please, in "there were ... updates" add "since 2 december, 1998"(i.e.)
<HTML>
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
last = getCookie("Last visit");
if (last == null) last = "0";
lastVisit = parseInt(last);
lastVisit *= 1000;
today = new Date();
expdate = new Date();
expdate.setTime(expdate.ge tTime() + 30*24*60*60*1000);
setCookie("Last visit", today.getTime()/1000, expdate);
descriptions = new Array();
dates = new Array();
// List all updates
// To get the code that you should use, open up Netscape and write
// mocha:getCode()
// In the location field
addUpdate("Bug fixes", 914280388850);
addUpdate("Minor improvements", 914280529020);
addUpdate("Date formatting and allUpdates() function", 914342950000);
// Function declarations
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates since " + formatDate(dates[0]) + ".";
}
location.href = "write.htm?" + escape(code);
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se arch);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf("; ", offset);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s ubstring(o ffset, end));
}
}
}
function addUpdate(description, date) {
descriptions[descriptions. length] = description;
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
function formatDate(date) {
d = new Date(date);
// hh:mm
h = d.getHours();
m = d.getMinutes();
time = ((h<10) ? "0"+h : h) + ":" + ((m<10) ? "0"+m : m);
// month
months = new Array(12);
months[0] = "January"; months[1] = "February"; months[2] = "March";
months[3] = "April"; months[4] = "May"; months[5] = "June";
months[6] = "July"; months[7] = "August"; months[8] = "September";
months[9] = "October"; months[10] = "November"; months[11] = "December";
month = months[d.getMonth()];
// day
day = d.getDate() + "";
last = day.substring(day.length-1 );
if (last == "1") day += "st";
else if (last == "2") day += "nd";
else if (last == "3") day += "rd";
else day += "th";
return day + " of " + month + ", " + (d.getYear()+1900);
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
document.write('<FORM><INP UT TYPE="BUTTON" VALUE="All updates" onClick="allUpdates()"></F ORM>');
// -->
</SCRIPT>
</BODY>
</HTML>
You will also need write.htm:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (location.search && location.search.length > 0)
document.write(unescape(lo cation.sea rch.substr ing(1)));
// -->
</SCRIPT>
</HEAD>
</HTML>
Merry Christmas, Martin
<HEAD>
<TITLE>What's new?</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Initialization
last = getCookie("Last visit");
if (last == null) last = "0";
lastVisit = parseInt(last);
lastVisit *= 1000;
today = new Date();
expdate = new Date();
expdate.setTime(expdate.ge
setCookie("Last visit", today.getTime()/1000, expdate);
descriptions = new Array();
dates = new Array();
// List all updates
// To get the code that you should use, open up Netscape and write
// mocha:getCode()
// In the location field
addUpdate("Bug fixes", 914280388850);
addUpdate("Minor improvements", 914280529020);
addUpdate("Date formatting and allUpdates() function", 914342950000);
// Function declarations
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates since " + formatDate(dates[0]) + ".";
}
location.href = "write.htm?" + escape(code);
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<B>" + formatDate(dates[i]) + "</B><BR>" + descriptions[i] + "<P>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P>" + s;
}
function setCookie(name, value, expire) {
document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : (";expires=" + expire.toGMTString()));
}
function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(se
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.s
}
}
}
function addUpdate(description, date) {
descriptions[descriptions.
dates[dates.length] = date;
}
function getCode() {
d = new Date();
prompt("Here's the code:", 'addUpdate("...", ' + d.getTime() + ')');
}
function formatDate(date) {
d = new Date(date);
// hh:mm
h = d.getHours();
m = d.getMinutes();
time = ((h<10) ? "0"+h : h) + ":" + ((m<10) ? "0"+m : m);
// month
months = new Array(12);
months[0] = "January"; months[1] = "February"; months[2] = "March";
months[3] = "April"; months[4] = "May"; months[5] = "June";
months[6] = "July"; months[7] = "August"; months[8] = "September";
months[9] = "October"; months[10] = "November"; months[11] = "December";
month = months[d.getMonth()];
// day
day = d.getDate() + "";
last = day.substring(day.length-1
if (last == "1") day += "st";
else if (last == "2") day += "nd";
else if (last == "3") day += "rd";
else day += "th";
return day + " of " + month + ", " + (d.getYear()+1900);
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(updates());
document.write('<FORM><INP
// -->
</SCRIPT>
</BODY>
</HTML>
You will also need write.htm:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (location.search && location.search.length > 0)
document.write(unescape(lo
// -->
</SCRIPT>
</HEAD>
</HTML>
Merry Christmas, Martin
ASKER
Very sorry, but I have forgotten one thing :
1)what's mocha:getcode() and how to use it (nothing happens when I write it in location)
2)how to calculate update's time (in addupdate() )
3)can you please do it to look as that page : "www.geocities.com/TimesSquare/Portal/9206/news.html"
4)when I press allupdates button, all is ok, but there's very many **** in location bar.
I appreciate your great efforts for so few points - sorry, I'm lack of them
1)what's mocha:getcode() and how to use it (nothing happens when I write it in location)
2)how to calculate update's time (in addupdate() )
3)can you please do it to look as that page : "www.geocities.com/TimesSquare/Portal/9206/news.html"
4)when I press allupdates button, all is ok, but there's very many **** in location bar.
I appreciate your great efforts for so few points - sorry, I'm lack of them
ASKER
Can allupdates be done without write.htm?
ASKER
Please, do it, I pray that it's last thing that I ask about it - I'll accept your next answer.
BIG thanx to you.
BIG thanx to you.
1) what's mocha:getcode() and how to use it (nothing happens when I write it in location)
Are you using Netscape? BTW, it should be
mocha:getCode()
2)how to calculate update's time (in addupdate())
mocha:getCode()
will give you the code to copy and paste it in.
3)can you please do it to look as that page: "www.geocities.com/TimesSquare/Portal/9206/news.html"
Here are the two functions that are changed:
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<H3>Update at " + formatDate(dates[i]) + " :</H3>\n<BLOCKQUOTE>" + descriptions[i] + "\n</BLOCKQUOTE>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates since " + formatDate(dates[0]) + ".";
}
location.href = "write.htm?" + escape(code);
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<H3>Update at " + formatDate(dates[i]) + " :</H3>\n<BLOCKQUOTE>" + descriptions[i] + "\n</BLOCKQUOTE>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P><CODE>" + s + "<P></CODE>";
}
4)when I press allupdates button, all is ok, but there's very many **** in location bar.
Can allupdates be done without write.htm?
It can be done in another way, but then you'll have to use cookies. Since cookies can be turned of there's a risk that nothing will show up. Do you want me to implement them anyway (if they don't accept them it's their problem, right?:-))?
There will still be a redirection to another page (not neccesarily write.htm, it could be allupdates.htm or something like that).
Merry Christmas, Martin
Are you using Netscape? BTW, it should be
mocha:getCode()
2)how to calculate update's time (in addupdate())
mocha:getCode()
will give you the code to copy and paste it in.
3)can you please do it to look as that page: "www.geocities.com/TimesSquare/Portal/9206/news.html"
Here are the two functions that are changed:
function allUpdates() {
if (dates.length == 0)
code = "The list of updates is currently empty.";
else {
code = "<TITLE>All updates</TITLE>";
for (i=0;i<dates.length;i++)
code += "<H3>Update at " + formatDate(dates[i]) + " :</H3>\n<BLOCKQUOTE>" + descriptions[i] + "\n</BLOCKQUOTE>";
code += "<P><HR>There have been <B>" + dates.length + "</B> updates since " + formatDate(dates[0]) + ".";
}
location.href = "write.htm?" + escape(code);
}
function updates() {
s = "";
for (i=0;i<dates.length;i++) {
if (dates[i] > lastVisit)
s += "<H3>Update at " + formatDate(dates[i]) + " :</H3>\n<BLOCKQUOTE>" + descriptions[i] + "\n</BLOCKQUOTE>";
}
if (s == "")
return "Nothing has happened around here since the last time you were here.";
else
return "This has happened since your last visit:<P><CODE>" + s + "<P></CODE>";
}
4)when I press allupdates button, all is ok, but there's very many **** in location bar.
Can allupdates be done without write.htm?
It can be done in another way, but then you'll have to use cookies. Since cookies can be turned of there's a risk that nothing will show up. Do you want me to implement them anyway (if they don't accept them it's their problem, right?:-))?
There will still be a redirection to another page (not neccesarily write.htm, it could be allupdates.htm or something like that).
Merry Christmas, Martin
ASKER
Ok, but I still don't know how to use mocha:getCode() (it doesn't does nothing)
Can you give me example of using it?
Btw, I use Netscape 4.5
Can you give me example of using it?
Btw, I use Netscape 4.5
ASKER
Also, please add <code> to place where <blockquote> is.
Can you PLEASE do so that it would be almost identical to my page.
Big thanx to you, you're great guy to deal with!
Can you PLEASE do so that it would be almost identical to my page.
Big thanx to you, you're great guy to deal with!
ASKER
Ok, mocha:getCode() works, but does it return current time? Can it return any time (i.e. mocha:getCode(22,12,1998) which stands for 22th of December, 1998). Thanx one more time.
It looks just like your home page already.
Here's the new getCode():
function getCode(d, m, y) {
if (y && y < 1900) y += 1900;
k = new Date();
params = (y ? y : k.getYear()) + ',' + (m ? m-1 : k.getMonth()) + ',' + (d ? d : k.getDate());
eval("a = new Date(" + params + ")");
prompt("Here's the code:", 'addUpdate("...", ' + a.getTime() + ')');
}
Martin
Here's the new getCode():
function getCode(d, m, y) {
if (y && y < 1900) y += 1900;
k = new Date();
params = (y ? y : k.getYear()) + ',' + (m ? m-1 : k.getMonth()) + ',' + (d ? d : k.getDate());
eval("a = new Date(" + params + ")");
prompt("Here's the code:", 'addUpdate("...", ' + a.getTime() + ')');
}
Martin
ASKER
Ok, I'm satisfied. Thanx and answer this q
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
At last it's done just superb
Steve