Try to use "without function format" like this :
<body>
<img src="" id="pic" />
<script type="text/javascript">
var gfx = new Array();
gfx[0] = "12.JPG";
gfx[1] = "123.JPG";
gfx[2] = "1234.JPG";
gfx[3] = "12345.JPG";
today2 = new Date();
len = 4;
today = today2.getTime()/1;
rnd = today % len;
document.getElementById("pic").src = gfx[rnd];
</script>
</body>
I mean that, move your script procedure after the HTML
"img", or put
that script section into a function, and call that function
after all
the page is loaded.
I'm sorry that I am not sure what did happen to you. this is
an advice
above.
On Feb 12, 6:36 am, "rossmil... gmail.com"
<rossmil... gmail.com>
wrote:
> Hey all, I have a personal homepage that I've been
working on (just
> for fun as a hobby) I'm working on an update to the
site
> (www.rosstmiller.com) and in the new version I have
four fields in
> which I would like a random image to show up. My script
works well on
> safari but on Firefox the images don't display (I don't
know about
> IE). Every part of my page is made with images hosted
by googlepages
> for ease of uploading and everything works except the
four random
> pictures. I'll include the script for one of the fields
and if you
> know how to get the images to show up please let me
know!
>
> Thanks
>
> <script type="javascript">
> <!--
> {gfx=new Array()
> // put url's for randomly selected
graphics here
> gfx[0]="'http
://rossmiller.googlepages.com/dsc01958_1.jpg'"
> gfx[1]="'http
://rossmiller.googlepages.com/dsc03754_1.jpg'"
> gfx[2]="'http
://rossmiller.googlepages.com/dsc04402_1.jpg'"
> gfx[3]="'http
://rossmiller.googlepages.com/dsc04958_1.jpg'"
>
> today2=new Date()
> len=4
> today=today2.getTime()/1
> rnd=today % len
> document.writeln('<IMG
SRC="'+gfx[rnd]+'">')}
> //-->
> </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Information googlegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
?hl=en
-~----------~----~----~----~------~----~------~--~---
|