PDA

نسخه کامل مشاهده نسخه کامل : چند تا کد جاوا



محمد گل
27-10-2006, 22:33
به نام خدا

کد های جاوا

کد خوش آمدگویی در بالای صفحه :
<head>
<script language="JavaScript1.2">


var message="به وبلاگ من خوش امدید قدم رنجه فرمودید راستی نظر یادت نره اااا " //specifys the title
var message=message+" " //gives a pause at the end,1 space=1 speed unit, here I used 10 spaces@150 each = 1.5seconds.
i="0" //declares the variable and sets it to start at 0
var temptitle="" //declares the variable and sets it to have no value yet.
var speed="150" //the delay in milliseconds between letters

function titler(){
if (!document.all&&!document.getElementById)
return
document.title=temptitle+message.charAt(i) //sets the initial title
temptitle=temptitle+message.charAt(i) //increases the title by one letter
i++ //increments the counter
if(i==message.length) //determines the end of the message
{
i="0" //resets the counter at the end of the message
temptitle="" //resets the title to a blank value
}
setTimeout("titler()",speed) //Restarts. Remove line for no-repeat.
}

window.onload=titler
</script>
</head></body>

معرفی به 50 موتور جستجو
<table width="400" border="0" align="center">
<tr>
<td height="239"> <FORM name=form3 action=[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] method=get>
<P align=center><strong>Submit Your Site To Over 50 Search
Engines TODAY! </strong><span style="FONT-SIZE: 9pt; COLOR: #334456; FONT-FAMILY: Arial"><span style="DISPLAY: none">
<input type=hidden value=20 name=timeout>
<input type=hidden value=WorldWide name=country>
<input type=hidden value="URL Submitter" name=name>
</span></span></P>
<div align="center">
<table cellspacing=0 cellpadding=0 width=338 align=center border=0>
<tbody>
<tr>
<td class=Normal> </td>
<td class=Normal bgcolor=#003366 colspan=5> <p align=center><font color=#EBEBEB><strong>Submit
Your Site for FREE!</strong></font></p></td>
<td class=Normal bgcolor=#ffffff> </td>
</tr>
<tr>
<td class=Normal width=11> </td>
<td class=Normal width=72 bgcolor=#003366> <p align=left><font face="Times New Roman, Times, serif"
color=#FFFFFF><b><span
style="COLOR: #EBEBEB; FONT-FAMILY: Helvetica">URL</span></b></font></p></td>
<td class=Normal bgcolor=#003366 colspan=4> <p align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica">
<input maxlength=255 value=[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ] name=url>
</span></p></td>
<td class=Normal width=8 bgcolor=#ffffff> </td>
</tr>
<tr>
<td class=Normal width=11> </td>
<td class=Normal width=72 bgcolor=#003366> <p align=left><font face="Times New Roman, Times, serif"
color=#FFFFFF><b><span
style="COLOR: #EBEBEB; FONT-FAMILY: Helvetica">Email</span></b></font></p></td>
<td class=Normal bgcolor=#003366 colspan=4> <p align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica">
<input
maxlength=255 name=email>
</span></p></td>
<td class=Normal width=8 bgcolor=#ffffff> </td>
</tr>
<tr>
<td class=Normal width=11> </td>
<td class=Normal width=72 bgcolor=#003366> <p align=left><font face="Times New Roman, Times, serif"
color=#FFFFFF><b><span
style="COLOR: #EBEBEB; FONT-FAMILY: Helvetica">Title</span></b></font></p></td>
<td class=Normal bgcolor=#003366 colspan=4> <p align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica">
<input
maxlength=255 name=title>
</span></p></td>
<td class=Normal width=8 bgcolor=#ffffff> </td>
</tr>
<tr>
<td class=Normal width=11> </td>
<td class=Normal width=72 bgcolor=#003366> <p align=left><font face="Times New Roman, Times, serif"
color=#cccccc><b><span
style="COLOR: #2d707d; FONT-FAMILY: Helvetica"><font color="#EBEBEB">Keywords</font>:</span></b></font></p></td>
<td class=Normal bgcolor=#003366 colspan=4> <p align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica">
<input maxlength=255 name=keywords>
</span></p></td>
<td class=Normal width=8 bgcolor=#ffffff> </td>
</tr>
<tr>
<td class=Normal colspan=6 height=5> </td>
<td class=Normal width=8> </td>
</tr>
<tr>
<td class=Normal colspan=2 height=25> </td>
<td class=Normal width=68 bgcolor=#003366> <div align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica"><b><a
onClick=form3.reset href="" target="_self"><img id=_x0000_i1060 height=22 src="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]" width=67 border=0
name=Reset></a> </b></span></div></td>
<td class=Normal width=8> </td>
<td class=Normal width=69 bgcolor=#003366> <p align=left><span
style="FONT-SIZE: 7.5pt; COLOR: #334456; FONT-FAMILY: Helvetica">
<input type=image height=22 width=68 src="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]" border=0 name=submitit
action="form3.submit">
</span></p></td>
<td class=Normal colspan=2> </td>
</tr>
<tr height=0>
<td class=Normal width=11 height=7></td>
<td class=Normal width=72></td>
<td class=Normal width=68></td>
<td class=Normal width=8></td>
<td class=Normal width=68></td>
<td class=Normal width=103></td>
<td class=Normal width=8></td>
</tr>
</tbody>
</table>
</div>
<P align=center><DIV align=center></P>
<div align="center"><font face="Arial, Helvetica, sans-serif" size="-2"><a href="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">Add
This Submitter To Your Site</a> Copyright © 2002,
<a href="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]"> Add-URL-Free</a></font>
</div>
</FORM>
</table>
<div align="center"></div>

نوشت یک متن درون یک فیلد
<html>
<head>

<script language="javascript" type="text/javascript">
dayInfo = new Array
dayInfo[2] = "Dad's Birthday"
dayInfo[5] = "Rehearsal Dinner"
dayInfo[6] = "Wedding Day"
function showInfo(thisDay) {
document.calendar.dateInfo.value = dayInfo[thisDay]
}
</script>

</head>
<body>
<a href="javascript:showInfo(2)">1</a>
<br>
<a href="javascript:showInfo(5)">5</a>
<br>
<a href="javascript:showInfo(6)">6</a>
<p>
<form name="calendar">
<input name="dateInfo" size="20">
</form>
</body>
</html>

کد لینک زیرشاخه ای
<!-- This script opens a separate window for the locations you give it.
Pages are neat but pictures make a cool photo album. Change the
attributes that read menubar=0,toolbar=0, etc... and Width & Height
to meet your needs. Make sure you place the URL's you want to go
to and their names below.-->

<script language="JavaScript">
<!-- Hide the script from old browsers --
function surfto(form)
{
var myindex=form.dest.selectedIndex
window.open(form.dest.options[myindex].value,"main","menubar=1,toolbar=0,location=0,directories=0,statu s=1,copyhistory=0,width=235,height=235");
}
//-->
</SCRIPT>
<CENTER>
<FORM NAME="myform">
<SELECT NAME="dest" SIZE=1>
<OPTION VALUE="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">CoffeeCup Software
<OPTION VALUE="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">Too Much Coffee Man
<OPTION VALUE="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">Netscape
<OPTION VALUE="[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]">InfoSeek
</SELECT>
<P>
<INPUT TYPE="BUTTON" VALUE="Go !" onClick="surfto(this.form)">
</FORM>
</CENTER>

دریافت نام کاربر و خوش آمدگویی
<HEAD>
<meta [ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]"Content-Type" content="text/html; charset=utf-8">
<SCRIPT LANGUAGE="Javascript">
var namePrompt = prompt("ببخشيد اسم شريفتون؟","");
function dispname (namePrompt) {
document.write(""+namePrompt+"");
}
</SCRIPT>
<BODY>

<CENTER>
<SCRIPT LANGUAGE="Javascript">
document.write("<font size=3 color=red> خوش امدی عزيزم, ");
dispname(namePrompt);
document.write("!</font>");
</SCRIPT>
</CENTER></body>
</html>
</body>
</html>

کد جلوگیری از ذخیره شدن صفحه
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>
<SCRIPT language=JavaScript1.2>
function disableselect(e){
return false
}
function reEnable(){
return true
}
</SCRIPT>
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>

کد جلوگیری از ذخیره ی صفحه و انتخاب نوشته ها
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>
<SCRIPT language=JavaScript1.2>
//Disable select-text script (IE4+, NS6+)
//Exclusive permission granted to Dynamic Drive to feature script
function disableselect(e){
return false
}

function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</SCRIPT>
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>

اجرای موزیک در وبلاگ
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<EMBED SRC='ادرس وب اهنگ در اینجا' WIDTH=120 HEIGHT=26 LOOP=true type=audio/x-pn-realaudio-plugin></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top align=left width=4

</body>
</html>
<!----[ برای مشاهده لینک ، لطفا با نام کاربری خود وارد شوید یا ثبت نام کنید ]>

بارش برف در وبلاگ
<html>
<body bgcolor="#228B22">
<style>
.drop { position: absolute; width: 3; filter: flipV(), flipH(); font-size: 40; color: blue }
</style>
<script language="javascript">
snow = true;
snowsym = " * "
rainsym = " ' "
howmany = 25
if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}
else{sym = rainsym; speed=50; drops=howmany; angle=6}
movex = -speed/angle; movey = speed; count = 0;

function moverain(){
for(move = 0; move < drops; move++){
xx[move]+=movex; yy[move]+=mv[move];
hmm = Math.round(Math.random()*1);
if(xx[move] < 0){xx[move] = maxx+10;}
if(yy[move] > maxy){yy[move] = 10;}
drop[move].left = xx[move]
drop[move].top = yy[move]+document.body.scrollTop;
}setTimeout('moverain()','1')}

</script>
<script language="javascript">

if (document.all){
drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()
ly = "document.all[\'"; st = "\'].style"
for(make = 0; make < drops; make++){
document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');
drop[make] = eval(ly+'drop'+make+st);
maxx = document.body.clientWidth-40
maxy = document.body.clientHeight-40
xx[make] = Math.random()*maxx;
yy[make] = -100-Math.random()*maxy;
drop[make].left = xx[make]
drop[make].top = yy[make]
mv[make] = (Math.random()*5)+speed/4;
drop[make].fontSize = (Math.random()*10)+20;
//*Change (col = 'white) to (col =YOUR COLOR)*//
if(snow){col = 'white'}else{col = 'blue'}
drop[make].color = col;
}
window.onload=moverain
}
</script>
</html>

رنگارنگ کردن نوشته
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="JavaScript">

<!-- Hide the script from old browsers --
function MakeArray(n){
this.length=n;
for(var i=1; i<=n; i++) this[i]=i-1;
return this
}
hex=new MakeArray(16);
hex[11]="A";
hex[12]="B";
hex[13]="C";
hex[14]="D";
hex[15]="E";
hex[16]="F";

function ToHex(x){
// Changes a int to hex (in the range 0 to 255)
var high=x/16;
var s=high+"";
//1
s=s.substring(0,2);
//2 the combination of these are the same as the trunc function
high=parseInt(s,10);
//3
var left=hex[high+1];
// left part of the hex-value
var low=x-high*16;
// calculate the rest of the values
s=low+"";
//1
s=s.substring(0,2);
//2 the combination of these are the same as the trunc function
low=parseInt(s,10);
//3
var right=hex[low+1];
// right part of the hex-value
var string=left+""+right;
// add the high and low together
return string;
}

function fadein(text){
text=text.substring(3,text.length-4);
// gets rid of the HTML-comment-tags
color_d1=255;
color_d1b=255;
color_d1c=255;
// any value in 'begin' 0 to 255
mul=color_d1/text.length;
for(i=0;i<text.length;i++){
color_d1=mul*i;
color_d1b=255-mul*i;
color_d1c=255*Math.sin(i/(text.length/3));

// some other things you can try>> "=255-mul*i" to fade out, "=mul*i" to fade in, or try "255*Math.sin(i/(text.length/3))"
color_h1=ToHex(color_d1);
color_d2=mul*i;
color_h2=ToHex(color_d2);
//1b
color_h1b=ToHex(color_d1b);
color_d2b=mul*i;
color_h2b=ToHex(color_d2b);
//1c
color_h1c=ToHex(color_d1c);
color_d2c=mul*i;
color_h2c=ToHex(color_d2c);

document.write("<FONT COLOR='#FF"+color_h1+color_h2+"'>"+text.substring(i,i+1)+'</FONT>');

}
document.write('<p>');
for(i=0;i<text.length;i++){
color_d1=mul*i;
color_d1b=255-mul*i;
color_d1c=255*Math.sin(i/(text.length/3));

// some other things you can try>> "=255-mul*i" to fade out, "=mul*i" to fade in, or try "255*Math.sin(i/(text.length/3))"
color_h1=ToHex(color_d1);
color_d2=mul*i;
color_h2=ToHex(color_d2);
//1b
color_h1b=ToHex(color_d1b);
color_d2b=mul*i;
color_h2b=ToHex(color_d2b);
//1c
color_h1c=ToHex(color_d1c);
color_d2c=mul*i;
color_h2c=ToHex(color_d2c);

document.write("<FONT COLOR='#FF"+color_h1c+color_h2c+"'>"+text.substring(i,i+1)+'</FONT>');

}
document.write('<p>');
for(i=0;i<text.length;i++){
color_d1=mul*i;
color_d1b=255-mul*i;
color_d1c=255*Math.sin(i/(text.length/3));

// some other things you can try>> "=255-mul*i" to fade out, "=mul*i" to fade in, or try "255*Math.sin(i/(text.length/3))"
color_h1=ToHex(color_d1);
color_d2=mul*i;
color_h2=ToHex(color_d2);
//1b
color_h1b=ToHex(color_d1b);
color_d2b=mul*i;
color_h2b=ToHex(color_d2b);
//1c
color_h1c=ToHex(color_d1c);
color_d2c=mul*i;
color_h2c=ToHex(color_d2c);

document.write("<FONT COLOR='#FF"+color_h1b+color_h2b+"'>"+text.substring(i,i+1)+'</FONT>');

}

}
// --End Hiding Here -->

</script>

</HEAD>

<body bgcolor="000000" text="ffffff">

<center>


<SCRIPT LANGUAGE="JavaScript">

<!--
{
fadein("-->دلم از شنیدن نام خزان می لرزد****زیرا که من زاده تابستانم<!__");
}
//-->

</SCRIPT>

</body>
</HTML>

تعویض رنگ وبلاگ
<HTML>
<HEAD>
<TITLE>JavaScript Example</TITLE>
</HEAD>
<BODY>
<CENTER>
<FORM>
<INPUT TYPE="button" VALUE="silver" ONCLICK="document.bgColor='silver'">
<INPUT TYPE="button" VALUE="slate" ONCLICK="document.bgColor='lightslategray'">
<INPUT TYPE="button" VALUE="green" ONCLICK="document.bgColor='lightgreen'">
<INPUT TYPE="button" VALUE="blue" ONCLICK="document.bgColor='lightblue'">
<INPUT TYPE="button" VALUE="white" ONCLICK="document.bgColor='white'">
</FORM>
</BODY>
</HTML>

</body>
</html>

Hazy
28-10-2006, 15:43
تاپيك كدهاي جاوا تو انجمن هست ولي بازم دستت درد نكنه