Free Web Hosting PHP/mySQL
GlobalWeb.com.ru Forum Index GlobalWeb.com.ru
Free Web Hosting :: Commercial Web Hosting :: PHP/mySQL :: CGI/Perl
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

random text or image

 
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript
Author Message
piterasek



Joined: 03 Mar 2004
Posts: 26

PostPosted: Wed Mar 03, 2004 4:42 am    Post subject: random text or image Reply with quote

put this in the head section:

<script language=javascript>
function wri(){
tek=new Array();
tek[0]="first text or image<img src=your_image.jpg>";
tek[1]="another text or image";
tek[2]="one more and as many other as needed";
document.write(tek[Math.floor(Math.random()*tek.length)]);
}
</script>

feel free to add other tek[next_number]
then you need to call the script by putting script below at the place you want the function to appear in the body section of your html

<script language=javascript>wri()</script>

have fun and feel free to see how it works at www.piterasek.com
_________________
today will be yesterday tomorow
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript All times are GMT
Page 1 of 1

 


Free Web Hosting, Commercial Web Hosting, PHP/mySQL Copyright © 2009
Free Scripts Directory | Free Software Downloads | Newsgroups Directory | Optel.net | Mirroraty | Cruised.net | Hardware Keylogger