473,322 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Include random pages

I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.

Thanks

Apr 7 '07 #1
7 1231
idoxlr8 said the following on 4/7/2007 9:55 AM:
I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.
Pick a random page on the server and include it using server side code.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 7 '07 #2
That was my first thought but I dont have server side includes.
I was kinda looking for some JavaScript code to do the same with.
"Randy Webb" <Hi************@aol.comwrote in message
news:OM********************@giganews.com...
idoxlr8 said the following on 4/7/2007 9:55 AM:
>I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.

Pick a random page on the server and include it using server side code.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/

Apr 7 '07 #3
Randy Webb wrote on 07 apr 2007 in comp.lang.javascript:
idoxlr8 said the following on 4/7/2007 9:55 AM:
>I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.

Pick a random page on the server and include it using server side code.
Cannot be done using server side code, Randy,
at least not with IIS includes and ASP.

<!--#include virtual ="/dir/page.asp"-->

cannot be modified by serverside code.

A conditional server.execute(); is possible, meseems.

If the OP wants to follow up this serverside angle,
please do so on:

microsoft.public.inetserver.asp.general

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 7 '07 #4
Evertjan. said the following on 4/7/2007 1:21 PM:
Randy Webb wrote on 07 apr 2007 in comp.lang.javascript:
>idoxlr8 said the following on 4/7/2007 9:55 AM:
>>I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.
Pick a random page on the server and include it using server side code.

Cannot be done using server side code, Randy,
at least not with IIS includes and ASP.
Makes me glad I use PHP as I can dynamically include files.

<snip>
If the OP wants to follow up this serverside angle,
please do so on:

microsoft.public.inetserver.asp.general
Assuming ASP though :)

comp.lang.php

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 7 '07 #5
Randy Webb said the following on 4/7/2007 6:18 PM:
Evertjan. said the following on 4/7/2007 1:21 PM:
>Randy Webb wrote on 07 apr 2007 in comp.lang.javascript:
>>idoxlr8 said the following on 4/7/2007 9:55 AM:
I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.
Pick a random page on the server and include it using server side code.

Cannot be done using server side code, Randy, at least not with IIS
includes and ASP.

Makes me glad I use PHP as I can dynamically include files.
But another problem is F5 doesn't guarantee a trip to the server to get
a new layout.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 7 '07 #6
In comp.lang.javascript message <ev*********@enews1.newsguy.com>, Sat, 7
Apr 2007 08:55:58, idoxlr8 <id*************@gmail.composted:
>I have a page that has an included page.
I would like to change the included page to a randomly selected page
whenever the main page is refreshed. Any pointers would be appreciated.
Read the FAQ to see how to get a random number in 0..N-1.

Use that, onLoad, to compose the name of the page to be included.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Apr 7 '07 #7
Randy Webb wrote on 08 apr 2007 in comp.lang.javascript:
Evertjan. said the following on 4/7/2007 1:21 PM:
>Randy Webb wrote on 07 apr 2007 in comp.lang.javascript:
>>idoxlr8 said the following on 4/7/2007 9:55 AM:
I have a page that has an included page.
I would like to change the included page to a randomly selected
page whenever the main page is refreshed. Any pointers would be
appreciated.
Pick a random page on the server and include it using server side
code.

Cannot be done using server side code, Randy,
at least not with IIS includes and ASP.

Makes me glad I use PHP as I can dynamically include files.

<snip>
>If the OP wants to follow up this serverside angle,
please do so on:

microsoft.public.inetserver.asp.general

Assuming ASP though :)
Do you see, Randy, any other way of using javascript,
using serverside inclusion?
comp.lang.php

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 8 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jerz | last post by:
I have a php file which include() 's a file with variables, and a file with functions. so: <? include("../data/common.inc") ?> <? include("../data/functions.inc") ?> if in the php file i...
3
by: Heath | last post by:
Using MSIE 5+ Heath writes: My problem deals with working with window objects between pages as follows: My Introduction page contains a link to my Action page. The onClick of that link...
7
by: Chad Scharf | last post by:
I have a legacy ASP application running on IIS 6.0 (Windows Server 2003 Web Edition) that is throwing an error when processesing a certain asp page that has about 200 or so include directives. ...
10
by: Toke H?iland-J?rgensen | last post by:
Hello. I am quite new to the c++ language, and am still trying to learn it. I recently discovered how using include files would allow me to split up my code into smaller segments, instead of having...
4
by: SoulSniper | last post by:
Hi, I have been stuck on this for a few days now and have given up trawling through pages and pages of google results.. I'm just putting the finishing touches to a small game I've written....
3
by: TaTonka | last post by:
hi! how can i manage it (html or jscript with css) that everytime a user loads or refreshes a page, the page has a new bgcolor. i want to put it in a single file, so that all my pages have the...
3
by: groucho | last post by:
I want to click on text and have it open a different *random* webpage every time from a list of urls I have already provided. So if I have 3 pages - p1, p2, p3 - i want to be able to click the...
4
by: Christina | last post by:
A project I am working on requires 5 random popup windows that rotate. A cookie is set each time one of the popups occurs with a 5 day expire period. The visitor isn't supposed to see the same...
34
by: Johannes Baagoe | last post by:
About Math.random(), ECMA 262 just says "Returns a number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.