GetDotted Domains

Viewing Thread:
"JavaScript Problem"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Mon 15/07/02 at 19:30
Regular
Posts: 787
Okay, i'm very new to JavaScript and only done 3 different scripts, but my fourth seems to have gone wrong:



I'm trying to get random images up, any help would be brilliant. By the way, the spaces aren't actually there, just because of SR's length restrictions. Thanks!

RiCkOsS
Wed 17/07/02 at 20:40
Regular
Posts: 10,437
Thanks for all the help guys, it's working now! Oh and Nimco, don't laugh at me, i'm only 14 :-(
Wed 17/07/02 at 17:15
"High polygon count"
Posts: 15,624
I don't know if you've sorted this, or if this will be any help, but I just got this in an e-mail from Bravenet. I remembered this thread, so thought I'd post it here...

-----

Displaying a Random Image and Hyperlink
Want to randomly display images and hyperlinks from a list? No problem, you can do it with a simple script like the one shown here. No need to learn server-side scripting, or slow down your pages with full-blown Java applications.

The script shown below randomly loads an image from the list you input each time a page is loaded into a browser. This example works with two images. You can add as many as you like. You can even add the same image twice to double its weighting. For example, if you have two images and would like one to be shown twice as much as the other one, simply add the preferred image twice (to total three images in all).

Here's the Script Code. All you have to do is replace the variable "imagenumber" with the correct amount of images you're using. Be sure to label each image with its corresponding number in the images array. Then do the same for the corresponding links. You can also control your image attributes in the display portion of this script, which begins with "document.write" ...

That's it. Load in your info, place the code where you want the images/links to display, refresh the page and watch what happens!



Naturally, you'll have to do a bit of editing to get your own images and links in place. Be sure to keep the imagenumber in sync with however many images and links you wish to use.
Wed 17/07/02 at 09:35
Regular
"IT'S ALIVE!!"
Posts: 4,741
:p thats 2 more than it needs and it's hardly a big script.
Tue 16/07/02 at 18:52
Posts: 0
RiCk0sS wrote:
> Shouldn't the function random_page() line be function random_image()
> because i don't want the page to be random,just the image. Whenever i
> load up the page it seems to re-direct to my pop-up.

lol. no, the function name has no bearing on what loads - you can rename it to random_image() if you want...

> That script has a lot of page functions (not that I know much
> about Javascript)

lol. it has 2.
Tue 16/07/02 at 16:34
Regular
"IT'S ALIVE!!"
Posts: 4,741
That script has a lot of page functions (not that I know much about Javascript)

Tue 16/07/02 at 16:21
Regular
Posts: 10,437
Shouldn't the function random_page() line be function random_image() because i don't want the page to be random,just the image. Whenever i load up the page it seems to re-direct to my pop-up.
Mon 15/07/02 at 20:33
Posts: 0


---------------

try that instead - note the spaces in the url
Mon 15/07/02 at 19:30
Regular
Posts: 10,437
Okay, i'm very new to JavaScript and only done 3 different scripts, but my fourth seems to have gone wrong:



I'm trying to get random images up, any help would be brilliant. By the way, the spaces aren't actually there, just because of SR's length restrictions. Thanks!

RiCkOsS

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thanks!
Thank you for dealing with this so promptly it's nice having a service provider that offers a good service, rare to find nowadays.
Excellent support service!
I have always found the support staff to provide an excellent service on every occasion I've called.
Ben

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.