הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   פונקציה רנדומלית בJS (https://hosts.co.il/forums/showthread.php?t=73860)

SmartSeo 23-04-09 18:38

פונקציה רנדומלית בJS
 
אני מעוניין להציג לינקים באתר בצורה רנדומלית, כלומר להחליף את הסדר ביניהם, אני מעוניין דווקא בJD ולא בPHP

יש לי את הפונקציה הזאת, הבעיה שזה לא מציג לי את הלינקים...
מה אפשר לעשות?
תודה לעוזרים!

ציטוט:

<script type="text/javascript" language="JavaScript">
<!--
var r_text = new Array();
r_text[0] = "<a href='www.ccc.co.il'>בנק ישראל</a>";
r_text[1] = "And the sky is grey";
r_text[0] = "<a href='www.cco.co.il'>אנשים</
r_text[3] = "On a winter's day";
r_text[4] = "I'd be safe and warm";
r_text[5] = "If I was in L.A.";
r_text[6] = "California dreaming, On such a winter's day";
var i = Math.floor(7*Math.random())
document.write(r_text[i]);
//-->
</script>

גורילה 23-04-09 19:15

HTML קוד:

<script type="text/javascript">
var r_text = new Array();
r_text[0] = "<a href='www.ccc.co.il'>בנק ישראל</a>";
r_text[1] = "And the sky is grey";
r_text[2] = "<a href='www.cco.co.il'>אנשים</a>";
r_text[3] = "On a winter's day";
r_text[4] = "I'd be safe and warm";
r_text[5] = "If I was in L.A.";
r_text[6] = "California dreaming, On such a winter's day";
var i = Math.floor(7*Math.random())
document.write(r_text[i]);
</script>



כל הזמנים הם GMT +2. הזמן כעת הוא 13:01.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ