Jump to content

Hey everyone, I have a question. I have a blog and I would like to have the pages randomized every time someone connects/reloads the page. Is this possible, ohh and if that can't be done can I make random pictures display whenever someone connects/reloads the page? 

Link to comment
https://linustechtips.com/topic/700685-randomize-pages/
Share on other sites

Link to post
Share on other sites

19 hours ago, WhatComesAround said:

Hey everyone, I have a question. I have a blog and I would like to have the pages randomized every time someone connects/reloads the page. Is this possible, ohh and if that can't be done can I make random pictures display whenever someone connects/reloads the page? 

Yes this is possible. You'd have to do it in PHP though.

Link to comment
https://linustechtips.com/topic/700685-randomize-pages/#findComment-8964004
Share on other sites

Link to post
Share on other sites

6 hours ago, WhatComesAround said:

Damn it :/. I'll pass on that, don't have much time on my hands to play around with PHP and Java Script so I'll leave it as it is.

I mean otherwise you could use javascript to select a random string(URLS) from an array and load it into an iframe that spans the entire page, 

 

It's possible in other ways too but everything depends on what you've got setup currently.

If I feel like it I'll make a JSFiddle.

Link to comment
https://linustechtips.com/topic/700685-randomize-pages/#findComment-8965667
Share on other sites

Link to post
Share on other sites

On 02/12/2016 at 5:11 AM, WhatComesAround said:

I would like to have the pages randomized every time someone connects/reloads the page.

http://jsfiddle.net/af7edx0d/

Loads any URL in the array 1 second after the body has loaded.

you can change the time before it loads by changing the value of the setTimeout:

1000 = 1 second

10000=10 seconds

3000= 3 seconds.

Link to comment
https://linustechtips.com/topic/700685-randomize-pages/#findComment-8965707
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×