يسرنا أن
نقدم لكم أفضل أنواع الجافا المجموعة الأولى
ملاحظة هامة إذا لم اذكر
مكان وضع الكود فيتم وضعه في أي مكان بين وسمي
<body> ....
</body>
يقوم هذا الكود بإعطاء رسالة
على حسب الوقت ويمكنك وضعه في أي مكان من الصفحة ترغب فيه ويمكنك تغيير الجمل
بجمل من عندك
بسك روح أرقد؟؟! ارحم نفسك.. مب زين السهر زياده يضر صحتك ..
الساعة الان 2بعد منتصف الليل يسعد مساك وأقاتك ممكن طلب .. أذا شفت أي
وصلة لا تعمل خبرني عنها في الايميل ..الساعة الحين 10مساءً يسعد مساك
وأقاتك ممكن طلب .. أذا شفت أي وصلة لا تعمل خبرني عنها في الايميل
..الساعة الحين 10مساءً صباح الخير .. يارب يكون صباحك حلو وممتع ..
أتمنى لك يوم سعيد(@@).. الساعة الان 11صباحاً
وهذا الكود مثل سابقه ولكنه
أقل حجماُ
<script LANGUAGE="JavaScript">
<!--
currentTime = new Date();
if (currentTime.getHours() < 12)
document.write("صباح الرقة والاحساس ");
else if (currentTime.getHours() < 17)
document.write(" وقت الغداء .. تغدية أو بعدك ");
else
document.write("مساء الخير والاحساس والطيبة ");
//-->
</script>
هذا الكود لطلب الترشيح ضع
رابطة ترشيح موقعك مكان رابطة ترشيح موقع النور في أفضل مائة موقع شيعي وضع
الكود في أي مكان من الصفحة
<script language="JavaScript">
<!-- The JavaScript Source!! http://worldzone.net/arts/damma2000 -->
function vote () {
vote4alnadeem=window.open("http://www.allaboutshia.com/cgi-bin/autorank/rankem.cgi?id=alnor");
} function cancel () {}
if (confirm("هل ترشحني لأفضل مائة موقع شيعي ")) { vote();
} else cancel()
// --></script>
هذا الكود يقوم بنقلك إلى
رابطة بمجرد مرورالفارة عليه فقط هنا قم بتغيير الرابطة الموجودة في الكود
بالرابطة التي ترغب فيها وضع الكود في أي مكان ترغب فيه
<a href="" onmouseover="parent.location='http://ahmed-k.8m.com'">تعال هنا للتجربة </A>
كود يقوم بتحديث الصفحة عند
الضغط عليه ضعه في أي مكان داخل الصفحة وتستطيع تغيير شكله وهو يكون بالشكل
التالي
<input type="Button" name="lukk" value=" قم بتجديدالصفحة دائماً" style="font-size: x-small; font-family: Tahoma; font-weight: normal; color: ffffff; background-color: #3366cc;" onClick="javascript:location.reload()"></body>
لإضافة الموقع إلى المفضلة
ضعه في أي مكان داخل الجسم وغير ما يخصك فقط
<A href="javascript:window.external.AddFavorite('http://ahmed-k.8m.com',%20'ابوحميد موقع إسلامي ثقافي شامل وعام )')"><font size="3" face="Windows UI">اضف الموقع إلى المفضلة </font></A>
هذا الكود يقوم بتحديد نوع
المستعرض لديك ونظام التشغيل كما في المثال التالي
انت تستعمل: Microsoft Internet Explorer 4.0 (compatible; MSIE 6.0;
Windows 98; Win 9x 4.90)
انت تستعمل: Microsoft Internet Explorer 4.0 (compatible; MSIE 6.0;
Windows 98)
انت تستعمل: Microsoft Internet Explorer 4.0 (compatible; MSIE 6.0;
Windows 98) انت تستعمل: Microsoft Internet Explorer 4.0
(compatible; MSIE 6.0; Windows 98)
<center>
<script language="Javascript">
<!--
//http://ahmed-k.8m.com
document.write("انت تستعمل: <b>"+navigator.appName+" "+navigator.appVersion+"</b>");
//-->
</script>
</center>
هذا الكود يحدد درجو وضوح
الشاشة لديك
800 x 600 800 x 600 800 x 600 800 x 600
<script Language="JavaScript">
document.write(screen.width + " x " + screen.height)
</script>
ألة حاسبة
0
7
8
9
/
4
5
6
*
1
2
3
-
0
+/-
.
+
<div align="center">
<center><table border="2" width="200" cellspacing="0" cellpadding="0" bgcolor="#000000"
style="border-color:black" onClick="previouskey=event.srcElement.innerText">
<tr>
<td width="100%" bgcolor="#FFFFFF" id="result"
style="font:bold 20px Verdana;color:black;text-align='right'">0</td>
</tr>
<tr>
<td width="100%" valign="middle" align="center"><table border="0" width="100%"
cellspacing="0" cellpadding="0" style="font:bold 20px Verdana;color:white">
<tr>
<td width="80%" align="center"><table border="1" width="100%" cellspacing="0"
cellpadding="0" style="cursor:hand;font:bold 20px Verdana;color:white"
onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='yellow'"
onMouseout="event.srcElement.style.color='white'" onselectStart="return false"
onClick="calculate()" height="82">
<tr>
<td width="25%" align="center" height="17">7</td>
<td width="25%" align="center" height="17">8</td>
<td width="25%" align="center" height="17">9</td>
<td width="25%" align="center" height="17">/</td>
</tr>
<tr>
<td width="25%" align="center" height="19">4</td>
<td width="25%" align="center" height="19">5</td>
<td width="25%" align="center" height="19">6</td>
<td width="25%" align="center" height="19">*</td>
</tr>
<tr>
<td width="25%" align="center" height="19">1</td>
<td width="25%" align="center" height="19">2</td>
<td width="25%" align="center" height="19">3</td>
<td width="25%" align="center" height="19">-</td>
</tr>
<tr>
<td width="25%" align="center" height="19">0</td>
<td width="25%" align="center" height="19"
onClick="pn();previouskey=1;event.cancelBubble=true">+/-</td>
<td width="25%" align="center" height="19">.</td>
<td width="25%" align="center" height="19">+</td>
</tr>
</table>
</td>
<td width="20%"><div align="left"><table border="1" width="100%" cellspacing="0"
cellpadding="0">
<tr>
<td width="100%" style="cursor:hand;font:bold 20px Verdana;color:white;text-align:center"
onClick="result.innerText=0;results=''">C</td>
</tr>
</table>
</div><div align="left"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="81">
<tr>
<td width="100%" style="cursor:hand;font:bold 32px Verdana;color:white;text-align:center"
onMouseover="event.srcElement.style.color='yellow'"
onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</td>
</tr>
</table>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<script language="JavaScript1.2">
/*
DHTML Calculator Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var results=''
var previouskey=''
var re=/(\/|\*|\+|-)/
var re2=/(\/|\*|\+|-){2}$/
var re3=/.+(\/|\*|\+|-).+/
var re4=/\d|\./
var re5=/^[^\/\*\+].+\d$/
var re6=/\./
function calculate(){
if (event.srcElement.tagName=="TD"){
if (event.srcElement.innerText.match(re4)&&previouskey=="=")
results=''
if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
results+=event.srcElement.innerText
if (results.match(re2))
results=results.substring(0,results.length-2)+results.charAt(results.length-1)
result.innerText=results
}
}
function calculateresult(){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
function pn(){
if (result.innerText.charAt(0)!='-')
result.innerText=results='-'+result.innerText
else if (result.innerText.charAt(0)=='-')
result.innerText=results=result.innerText*(-1)
}
</script>
تقويم كما في الشكل التالي
March
3903
Sun
Mon
Tues
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
2:35 AM
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
August 3902
Sun
Mon
Tues
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
10:33 PM
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
August 3902
Sun
Mon
Tues
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
10:16 PM
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
July
3902
Sun
Mon
Tues
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
11:40 AM
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!-- JavaScript immediate script -->
<SCRIPT LANGUAGE="JavaScript">
<!--
// Copyright 1996 - Tomer and Yehuda Shiran
// This example will appear in our forthcoming book on JavaScript.
// Feel free to "steal" this code provided that you leave this notice as is.
// Additional examples from the book can be found at http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <الايميل>
setCal()
function getTime() {
// initialize time-related variables with current time settings
var now = new Date()
var hour = now.getHours()
var minute = now.getMinutes()
now = null
var ampm = ""
// validate hour values and set value of ampm
if (hour >= 12) {
hour -= 12
ampm = "PM"
} else
ampm = "AM"
hour = (hour == 0) ? 12 : hour
// add zero digit to a one digit minute
if (minute < 10)
minute = "0" + minute // do not parse this number!
// return time string
return hour + ":" + minute + " " + ampm
}
function leapYear(year) {
if (year % 4 == 0) // basic rule
return true // is leap year
/* else */ // else not needed when statement is "return"
return false // is not leap year
}
function getDays(month, year) {
// create array to hold number of days in each month
var ar = new Array(12)
ar[0] = 31 // January
ar[1] = (leapYear(year)) ? 29 : 28 // February
ar[2] = 31 // March
ar[3] = 30 // April
ar[4] = 31 // May
ar[5] = 30 // June
ar[6] = 31 // July
ar[7] = 31 // August
ar[8] = 30 // September
ar[9] = 31 // October
ar[10] = 30 // November
ar[11] = 31 // December
// return number of days in the specified month (parameter)
return ar[month]
}
function getMonthName(month) {
// create array to hold name of each month
var ar = new Array(12)
ar[0] = "January"
ar[1] = "February"
ar[2] = "March"
ar[3] = "April"
ar[4] = "May"
ar[5] = "June"
ar[6] = "July"
ar[7] = "August"
ar[8] = "September"
ar[9] = "October"
ar[10] = "November"
ar[11] = "December"
// return name of specified month (parameter)
return ar[month]
}
function setCal() {
// standard time attributes
var now = new Date()
var year = now.getYear()
var month = now.getMonth()
var monthName = getMonthName(month)
var date = now.getDate()
now = null
// create instance of first day of month, and extract the day on which it occurs
var firstDayInstance = new Date(year, month, 1)
var firstDay = firstDayInstance.getDay()
firstDayInstance = null
// number of days in current month
var days = getDays(month, year)
// call function to draw calendar
drawCal(firstDay + 1, days, date, monthName, 1900 + year)
}
function drawCal(firstDay, lastDate, date, monthName, year) {
// constant table settings
var headerHeight = 50 // height of the table's header cell
var border = 2 // 3D height of table's border
var cellspacing = 4 // width of table's border
var headerColor = "midnightblue" // color of table's header
var headerSize = "+3" // size of tables header font
var colWidth = 60 // width of columns in table
var dayCellHeight = 25 // height of cells containing days of the week
var dayColor = "darkblue" // color of font representing week days
var cellHeight = 40 // height of cells representing dates in the calendar
var todayColor = "red" // color specifying today's date in the calendar
var timeColor = "purple" // color of font representing current time
// create basic table structure
var text = "" // initialize accumulative variable to empty string
text += '<CENTER>'
text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + '>' // table settings
text += '<TH COLSPAN=7 HEIGHT=' + headerHeight + '>' // create table header cell
text += '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>' // set font for table header
text += monthName + ' ' + year
text += '</FONT>' // close table header's font settings
text += '</TH>' // close header cell
// variables to hold constant settings
var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'
openCol += '<FONT COLOR="' + dayColor + '">'
var closeCol = '</FONT></TD>'
// create array of abbreviated day names
var weekDay = new Array(7)
weekDay[0] = "Sun"
weekDay[1] = "Mon"
weekDay[2] = "Tues"
weekDay[3] = "Wed"
weekDay[4] = "Thu"
weekDay[5] = "Fri"
weekDay[6] = "Sat"
// create first row of table to set column width and specify week day
text += '<TR ALIGN="center" VALIGN="center">'
for (var dayNum = 0; dayNum < 7; ++dayNum) {
text += openCol + weekDay[dayNum] + closeCol
}
text += '</TR>'
// declaration and initialization of two variables to help with tables
var digit = 1
var curCell = 1
for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
text += '<TR ALIGN="right" VALIGN="top">'
for (var col = 1; col <= 7; ++col) {
if (digit > lastDate)
break
if (curCell < firstDay) {
text += '<TD></TD>';
curCell++
} else {
if (digit == date) { // current cell represent today's date
text += '<TD HEIGHT=' + cellHeight + '>'
text += '<FONT COLOR="' + todayColor + '">'
text += digit
text += '</FONT><BR>'
text += '<FONT COLOR="' + timeColor + '" SIZE=2>'
text += '<CENTER>' + getTime() + '</CENTER>'
text += '</FONT>'
text += '</TD>'
} else
text += '<TD HEIGHT=' + cellHeight + '>' + digit + '</TD>'
digit++
}
}
text += '</TR>'
}
// close all basic table tags
text += '</TABLE>'
text += '</CENTER>'
// print accumulative HTML string
document.write(text)
}
// -->
</SCRIPT>
هذد الكود يقوم بتحديث الصفحة
ألياً كل دقيقة وتستطيع تغييرزمن التحديث المناسب لك
<script>
<!--
/*
Auto Refresh Page with Time script
By Website Abstraction (http://go.to/Mr.T)
Over 200+ free scripts here!
*/
//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="01:10"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" : دقيقة ... لتحديث الصفحة "
else
curtime=cursec+" : ثانية ... لتحديث الصفحة "
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}
window.onload=beginrefresh
//-->
</script>
وهذا كوك تطلب فيه من الزائر
تحديث الموقع بالضغط عليه
<p align="center"><font color="#ffffff"><a href="JavaScript:window.location.reload()"><font face="Windows UI">لتحديث الموقع انقر هنا
</font></a><font face="Windows UI"> </font></font><a href="JavaScript:window.location.reload()">
</p>