Video e javës


   2 mije frejma n'sekond.
Diskutimet e fundit
[Today at 01:19:55 AM]

[May 10, 2008, 09:59:26 PM]

[May 09, 2008, 08:25:05 PM]

[May 09, 2008, 05:26:05 PM]

[May 09, 2008, 10:38:05 AM]

[May 08, 2008, 11:46:20 PM]

[May 08, 2008, 12:55:42 PM]

[May 08, 2008, 04:19:13 AM]

[May 07, 2008, 09:59:42 PM]

[May 07, 2008, 08:41:00 PM]
Muzike

Pages: [1] |   Go Down
  Send this topic  |  Print  
Topic: Random Link  (Read 282 times)
« on: April 01, 2008, 03:50:06 PM »
be a part of community.
daBaki. Online
Administrator
Full Member

*****
Posts: 217



Code:
<html>
<body>

<script type="text/javascript">
var r=Math.random();
if (r>0.5)
{
document.write("<a href='http://www.w3schools.com'>Learn Web Development!</a>");
}
else
{
document.write("<a href='http://www.refsnesdata.no'>Visit Refsnes Data!</a>");
}
</script>

</body>
</html>

ky code do te qes njeher, Learn Web Development! ndersa njeher Visit Refsnes Data!

Nese keni linqe me teper ateher modifikimi eshte me posht

Code:
<script type="text/javascript">
var r=Math.floor(Math.random()*5)+1;
document.write(r);
if (r==1)
{
document.write("<a href='http://www.w3schools.com'>Learn Web Development!</a>");
}
if(r==2)
{
document.write("<a href='http://www.refsnesdata.no'>Visit Refsnes Data!</a>");
}
if(r==3)
{
document.write("Linku shkon ketu");
}
if(r==4)
{
document.write("Linku shkon ketu");
}
if(r==5)
{
document.write("Linku shkon ketu");
}
</script>

Math.floor(Math.random()*5)+1; // ktu i prodhojm numrat random prej 0 - 4, dhe me +1 e bejme qe te kemi nga 1 deri ne 5
ndersa Math.random(); // prodhon numra te ndryshem prej 0 - 1.

Kjo ishte e tera sa i perket Random Link.

Logged

I am what I am because of who we all are.
 
Tags: Random Link  JavaScript  Script  Java  Programming 
Pages: [1] |   Go Up
  Send this topic  |  Print  
 
Jump to:  

Komuniteti i Teknologjise se Informacionit; diskutime, komuniteti, teknologjia, informatika, kompjutera, teknologji, programim, albania albanian technology, kosova kosovo technology, shkarkime, filma shqip, filma shqiptare, programe shqip, tutoriale, zone e lire, xxx zona.
SEKSIONE   Artikuj  |  Galeria  |  Tage

Na kontaktoni | Tregoja mikut | Ndihme | Kerko forumet

English Information | FAQ


Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks

©2008 ayih Organization. All rights reserved.