الجافا
إليكم مجموعات من بعض اوامر الجافا
الأولى
<SCRIPT Language="JavaScript"> <!-- Hide /* This script was written by Mike Cullen, 1999 Featured on Dynamic Drive () For full source code, installation instructions and many more DHTML scripts */ var scroller; var ampm; var actualtitle=document.title+" " function antiMilitaryTime() { if (hr == "12"){ ampm="P.M." } else if (hr == "13"){ hr="1" ampm="P.M." } else if (hr == "14"){ hr="2" ampm="P.M." } else if (hr == "15"){ hr ="3" ampm="P.M." } else if (hr == "16"){ hr = "4" ampm="P.M." } else if (hr == "17"){ hr = "5" ampm="P.M." } else if (hr == "18"){ hr = "6" ampm="P.M." } else if (hr == "19"){ hr = "7" ampm="P.M." } else if (hr == "20"){ hr = "8" ampm="P.M." } else if (hr == "21"){ hr = "9" ampm="P.M." } else if (hr == "22"){ hr = "10" ampm="P.M." } else if (hr == "23"){ hr = "11" ampm="P.M." } else if (hr == "24"){ hr = "12" } } function addZero(){ if (min <= "9"){ min = "0"+min } if (sec<= "9"){ sec = "0"+sec } if (hr <="9"){ hr = "0"+hr } } function time(){ dt=new Date() sec=dt.getSeconds() hr=dt.getHours() ampm="A.M." min=dt.getMinutes() } function scroll() { time() antiMilitaryTime() addZero() var scroller="TIME: "+hr+":"+min+":"+sec+" "+ampm var timeout=setTimeout("scroll()", 1000) document.title=actualtitle+scroller } if (document.all) scroll() //--> </SCRIPT>
<BODY onunload="stopTimer()" onLoad="startTimer()" > <SCRIPT> <!-- hide from non JS browsers. //Define a couple of global variables. var timerID = null var timerRunning = false function stopTimer(){ //stop the clock if(timerRunning) { clearTimeout(timerID) timerRunning = false } } function startTimer(){ // Stop the clock (in case it's running), then make it go. stopTimer() runClock() } function runClock(){ document.clock.face.value = timeNow() //Notice how setTimeout() calls its own calling function, runClock(). timerID = setTimeout("runClock()",1000) timerRunning = true } function timeNow() { //Grabs the current time and formats it into hh:mm:ss am/pm format. now = new Date() hours = now.getHours() minutes = now.getMinutes() seconds = now.getSeconds() timeStr = "" + ((hours > 12) ? hours - 12 : hours) timeStr += ((minutes < 10) ? ":0" : ":") + minutes timeStr += ((seconds < 10) ? ":0" : ":") + seconds timeStr += (hours >= 12) ? " PM" : " AM" return timeStr } // End of custom functions, stop hiding code --> </SCRIPT> <p> <CENTER><P><FORM NAME="clock"><INPUT TYPE="text" NAME="face" SIZE=11></FORM><p>
<html> <head> <title>Floating Time</title> <script language="JavaScript"> // Instructions: // This script combines a bunch of different scripts together to // create the effect of a "floating clock." First off, the browser // requirements are IE 4.0+. Other browsers will work, // but the clock will be in the status bar. Don't worry, there's // a browser detector included, to keep the script completely bug-free. // I've commented out all of the different sections, to try and make // it a little easier to understand. Here's a list of the features that // this "mega-script" includes: Real time clock, message based on the time, // browser detector, floating display, and AM/PM. There's very little // that you have to do to set this up; just the font size and color. // Start Time Function function makeclock() { // Declare the time variables var runTime = new Date() var hours = runTime.getHours() var minutes = runTime.getMinutes() var seconds = runTime.getSeconds() var dn = "AM" var msg = null if (hours > 12) { dn = "PM" hours -= 12 } if (hours == 0) { hours = 12 } // After all the definitions for "hours" are done, make the timely messages if (hours <= 12 && dn == "AM") { msg = "صباح الخير" } else if (hours <= 5 && dn == "PM") { msg = "مساء الخير" } else { msg = "مساء الورد" } // Continue on with regular time function if (minutes <= 9) { minutes = "0" + minutes } if (seconds <= 9) { seconds = "0" + seconds; } currtime = hours + ":" + minutes + ":" + seconds + " " + dn // Make sure that the browser is IE 4.0+ or compatible if (document.all) { currtime += "<br>" + msg var html document.all.clockface.innerHTML = currtime } // If the browser's not IE 4.0+, the clock displays in the status bar else { currtime += " - " + msg window.status = currtime } // Make sure that the clock keeps going var keepgoing = setTimeout("makeclock()", 1000) // Start the floater function check() } // End Time Function // Start floater code var mover = null if (navigator.appName.indexOf("Netscape") != -1) { var mover = "document.clockface.top = window.pageYOffset" } else { var mover = "clockface.style.pixelTop = document.body.scrollTop + 10" } function check() { object = "clockface" eval(mover) setTimeout("check()", 0) } // End floater code </script> </head> <!-- Don't forget the onLoad event handler --> <body onLoad="makeclock()"> <!-- Begin Style Sheet --> <!-- (to make the clock look pretty) --> <style type="text/css"> #clockface { background-color : White; border: 2px solid black; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 10pt; font-style : normal; padding : 1; color : Black; position:absolute; visibility:show; left:10px; top:10px; z-index:0 } </style> <!-- End Style Sheet --> <!-- Begin Clockface HTML --> <div id="float"> <div id="clockface"> </div> </div> <!-- End Clockface HTML --> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> </body> </html>
<html> <head> <title> Date and Time in Forms </title> <script language="JavaScript"> <!-- Hide this script from old browsers -- /* This script came from the 24 hour JavaScripts Site located at http://www.javascripts.com. It is brought to you by Eric Jarvies, Lewis Sellers, Giuseppe Lombardo, Kurt Anderson, and David Medinets. */ function gettheDate() { Todays = new Date(); TheDate = "" + (Todays.getMonth()+ 1) +" / "+ Todays.getDate() + " / " + Todays.getYear() document.clock.thedate.value = TheDate; } var timerID = null; var timerRunning = false; function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; } function startclock () { stopclock(); gettheDate() showtime(); } function showtime () { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds() var timeValue = "" + ((hours >12) ? hours -12 :hours) timeValue += ((minutes < 10) ? ":0" : ":") + minutes timeValue += ((seconds < 10) ? ":0" : ":") + seconds timeValue += (hours >= 12) ? " P.M." : " A.M." document.clock.face.value = timeValue; // you could replace the above with this // and have a clock on the status bar: // window.status = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } // -- End Hiding Here --> </script> </head> <body onLoad="startclock()" bgcolor="#FFFFFF"> <form name="clock" onSubmit="0"> <input type="text" name="thedate" size=12 value=""> <input type="text" name="face" size=12 value=""> </form> </body> </html>
<center> <script language="Javascript"> <!-- day = new Date() hr = day.getHours() hr1 = hr - 12 if (hr < "8") { document.write("بسك روح أرقد؟؟! ارحم نفسك.. مب زين السهر زياده يضر صحتك .. الساعة الان "+hr+"بعد منتصف الليل ") } else if (hr < "12") { document.write("صباح الخير .. يارب يكون صباحك حلو وممتع .. أتمنى لك يوم سعيد(@@).. الساعة الان "+hr+"صباحاً ") } else if (hr < "15") { document.write(" اذا تغدية بالصحة والعافية ! وأذا ما تغدية روح تغدى .. صارت الساعة "+hr1+"ظهراً") } else if (hr < "21") { document.write("مساء الخيروالاحساس والطيبه .. الساعة الان "+hr1+" ") } else if (hr < "23") { document.write("يسعد مساك وأقاتك ممكن طلب .. أذا شفت أي وصلة لا تعمل خبرني عنها في الايميل ..الساعة الحين "+hr1+"مساءً ") } else if (hr > "10") { document.write("تصبح على خير.. صارت الساعه "+hr1+" ليلاً ") } //--> //http://www.crosswinds.net/~damma2000 </script> </center>
ساعة بخلفية سوداء
<!-- This script has been in the http://www.javascripts.com Javascript Public Library! --> <!-- Note that though this material may have been in a public depository, certain author copyright restrictions may apply. --> <html> <head> <title>JavaClock v2.3 Written by The Transcendent</title> </head> <body> <script language = "javascript"> <!-- <!-- JavaScript Clock v2.3 Written By The Transcendent --> <!-- Entire script is to be placed wherever you want the clock to be --> <!-- these are the only variables (9) that you have to change, do not change anything else --> /* !!!These specifications are supported in both IE and Netscape. You MUST give these variables a value!!! */ var clockwidth = 12 //specify the clock width var clockvalue = "--- Clock ---" //the text in the clock before the body is completly loaded (needs quotes) /* !!!!!extra clock looks only available in IE, not supported in netscape!!!! */ var clockfeatures = "yes" // do you want the extra looks? if no, you do not have to change the next 5 variables (must keep quotes around yes/no) var backcolor = "#000000" //specify background color (needs quotes) var textcolor = "#eeeeee" //specify text color (needs quotes) var borderstyle = "solid" //specify the type of border ((in quotes, type "original" for the normal style, regardless of your color and width specs) none,dotted,dashed,solid,double,groove,ridge,inset,outset) var bordercolor = "#a00000" //specify border color (needs quotes) (type in 0 for the borderwidth if you dont want one) var borderwidth = 1 //specify border width (a number in pixels, (type in 0 if you dont want one) var fontfamily = "Arial" //specify font type (needs quotes) (type in 'null' if you dont care) <!-- ok, everything is taken care of! now just save the page, sit back and enjoy! --> document.onLoad = setInterval('chngtme()',100) if (document.all && clockfeatures=="yes") {document.write("<style> #clock { background: "+backcolor+"; color: "+textcolor+((borderstyle!='original')?'; border: '+bordercolor+' '+borderwidth+'px '+borderstyle+';':';')+" font-family: "+fontfamily+";} </style>")} function chngtme() { var t=new Date() var AP=((t.getHours()>=12)?" P.M.":" A.M.") var timeValue=""+((t.getHours()>12)?t.getHours()-12:(t.getHours()==0)?12:t.getHours()) timeValue+=((t.getMinutes()<10)?":0":":")+t.getMinutes() timeValue+=((t.getSeconds()<10)?":0":":")+t.getSeconds() timeValue+=AP document.clock.face.value=timeValue } document.write('<center><form name="clock" Action="#"><input id="clock" TYPE="text" NAME="face" SIZE="'+clockwidth+'" VALUE="'+clockvalue+'"></form></center>') <!-- End JavaScript Clock v2.1 --> //--> </script> </body> </html> <!-- Simba says Roar. -->
<script language="JavaScript1.2"> <!--hide //date in title by Randall Smith copyright 1999 //Permission given to Dynamicdrive.com to feature it in it's DHTML archive //Script modified by Dynamicdrive.com to make it cross browser friendly. Visit Dynamicdrive.com for more DHTML scripts //please visit me on the web at http://members.xoom.com/u4rstunzd/ //when it gets to the year 2000 you'll need to change the 19 to 20 if not when it's the year 2000 //it will show the year as 1900 to change it see where it says 19"+Year+" just change the 19 to 20 //and to change the title:where it says Welcome todays date is: just put you own text in if you would like to-- var isnMonth = new Array("January","February","March","April","May","June","July","August","Septerber","October","November","December"); var isnDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"); today = new Date () ; Year=today.getYear(); Date=today.getDate(); if (document.all) document.title="Welcome. today\'s date is: "+isnDay[today.getDay()]+", "+isnMonth[today.getMonth()]+" "+Date+", 19"+Year+"" //--hide--> </script>
<script LANGUAGE="JavaScript"> <!-- currentTime = new Date(); if (currentTime.getHours() < 12) document.write("صباح الرقة والاحساس "); else if (currentTime.getHours() < 17) document.write(" وقت الغداء .. تغدية أو بعدك "); else document.write("مساء الخير والاحساس والطيبة "); //--> </script>
© حقوق النشر محفوظة لموقع رحاب المحبة 2002-2003