wannabeeaweak 0 Report post Posted September 25, 2004 here this script will display the date for your user/visitors input it in a html file in the head or body <script language="Javascript"> <!-- /* Today's date script Visit java-scripts.net or http://www.javascriptkit.com/ for this script */ var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") var monName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") var now = new Date document.write("Today is " + dayName[now.getDay()] + ", " + monName[now.getMonth()] + " "+now.getDate() +".") //--> </script> Share this post Link to post Share on other sites
Bigyan 0 Report post Posted October 29, 2004 Don't you people ever get tired of writin these scripts ??I've written this script and seen this script atleast 20 times.Please stop writing these basic scripts Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 30, 2004 actually with php, i don't know what's the use of js. i don't even bother to learn it. this basic script show me what js can do, even if this script is really basic Share this post Link to post Share on other sites
bbdesign 0 Report post Posted November 4, 2004 Javascript will work on any browser that supports it because it is client-side. PHP only works on servers in which it is installed Share this post Link to post Share on other sites
Hercco 0 Report post Posted November 5, 2004 Javascript will work on any browser that supports it because it is client-side. PHP only works on servers in which it is installed <{POST_SNAPBACK}> And which do you think is best? As a web designer, with which one you know that user is seeing a date? And R3d Javascript is really worth learning. It isn't the best technology to get a date or time to your website but you can do lot of stuff that are really useful for your visitors. A typical example is manipulating form data on client side. For example, it is extremely useful to be able to check/uncheck all checkboxes at once. My view is that Javascript shouldn't be used to replace server-side stuff but to do stuff that are useful (ie. not just flashy) but not possible or very clumsy with server-side program. Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted November 6, 2004 The problem with JS is that it rely the user computer time, if the user computer date and time is not adjusted then the time showing will be inaccurate.For PHP it read the server time, no matter what date and time setting is made on the user computer the result will remain consistent and unaffected by the user computer setting.Most users will have no problem viewing becos PHP will return the time and date in plain text format whereas JS may have problem with users who choose to disable JS for security reasons and older browser that do not support JS.Hope the above explainations will help you to see what want you are choosing and what to expect. Share this post Link to post Share on other sites
lhunath 0 Report post Posted November 6, 2004 Don't you people ever get tired of writin these scripts ?? I've written this script and seen this script atleast 20 times. Please stop writing these basic scripts <{POST_SNAPBACK}> Thank you finally somebody who agrees with me. Even though I doubt he wrote it. I'm sure he copy pasted it from somewhere... *sigh* Share this post Link to post Share on other sites