The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[JAVA script]Header image that changes on refresh?

3 posters

Go down

[JAVA script]Header image that changes on refresh? Empty [JAVA script]Header image that changes on refresh?

Post by perca July 4th 2008, 3:15 pm

Hello there (once again)

I'm having some issues with my header. I would like to have pictures that would change once the user refreshes the page, and at the same time having all those header pictures linking to my main page ( http://http://limestripe.englishboards.com ). I also would like to being able to add more headers in the future, I just used those random 2 pictures to test the script ( https://2img.net/h/i271.photobucket.com/albums/jj148/mimids/zulzin.gif and https://2img.net/h/i271.photobucket.com/albums/jj148/mimids/zulzaum.gif )I tried using some scripts, but none worked. here an example of one of them:

Code:
<div align="center">
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()
theImages[0] = 'http://i271.photobucket.com/albums/jj148/mimids/zulzin.gif'
theImages[1] = 'http://i271.photobucket.com/albums/jj148/mimids/zulzaum.gif'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
  preBuffer[i] = new Image()
  preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
</script>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
showImage();
</script></BODY></div>

I dunno where to set this html page, tried just pasting this code on script generator's "free field". I have a feeling that all I'm doing is wrong, if anyone could please help me with the right script and how to make it work as my board header, I would be thankfull forever! (Yeah I'm kinda desperate already, as java is teaching me a lesson here T_T) Thank you in advance for any help and sorry for bothering (you guys always solve my retard problems, I'm so glad I joined this comm <3)
perca
perca
Forumember

Female Posts : 75
Reputation : 0
Language : Portuguese
Location : Brazil

http://limestripe.englishboards.com/

Back to top Go down

[JAVA script]Header image that changes on refresh? Empty Re: [JAVA script]Header image that changes on refresh?

Post by perca July 13th 2008, 10:17 pm

I'm still searching for a way to solve this, without success... Does any one know if it`s even possible to have a header that changes on refresh? It doesn't even need to link to another place, tough it would be neat XD Tx in advance for any help!
perca
perca
Forumember

Female Posts : 75
Reputation : 0
Language : Portuguese
Location : Brazil

http://limestripe.englishboards.com/

Back to top Go down

[JAVA script]Header image that changes on refresh? Empty Re: [JAVA script]Header image that changes on refresh?

Post by KirbySB July 14th 2008, 12:50 am

I'm not crazy on Javascript, I can only make a pop-up and a blank screen with text.
KirbySB
KirbySB
Forumember

Male Posts : 352
Reputation : 5
Language : English/Spanish

http://www.brolyhq.forumotion.net

Back to top Go down

[JAVA script]Header image that changes on refresh? Empty Re: [JAVA script]Header image that changes on refresh?

Post by perca July 14th 2008, 2:00 pm

so you can do teh header change and open a link in a new window? sorry if I got it wrong, but if you could help me...
perca
perca
Forumember

Female Posts : 75
Reputation : 0
Language : Portuguese
Location : Brazil

http://limestripe.englishboards.com/

Back to top Go down

[JAVA script]Header image that changes on refresh? Empty Re: [JAVA script]Header image that changes on refresh?

Post by Saurus July 15th 2008, 11:24 pm

Well first of all, the code you provided is incorrect. The part that starts the script,
Code:
<SCRIPT LANGUAGE="JavaScript">
is in the wrong format. It should be
Code:
<script type="text/javascript">
to be recognized. There is also no ending tag for the second script before closing the body tag and the closing div tag. So that script as written would never execute properly - it would run as a loop and error out.

I imagine Typlo could verify, but I don't think it's possible to do what you want without access to the headers and footers of the forum.
avatar
Saurus
Forumember

Male Posts : 789
Reputation : 10
Language : english
Location : NY

http://sunrisers.forumotion.com

Back to top Go down

[JAVA script]Header image that changes on refresh? Empty Re: [JAVA script]Header image that changes on refresh?

Post by perca July 16th 2008, 2:23 pm

Hum... I see. I got that script from a forum, Iknow nothing about java to see the mistake on the script T_T Tx forpointig out,guess I'll have to stick with the flashheader then
perca
perca
Forumember

Female Posts : 75
Reputation : 0
Language : Portuguese
Location : Brazil

http://limestripe.englishboards.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum