Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

HELP.. Need to change Javascript...

From relative to absolute URLS



8:26 am on Jan 7, 2001 (gmt 0)

Inactive Member
Account Expired


I found this cool, free java script called web slideshow.

It gives you a slideshow of different HTML pages (you define) that open up in an adjacent frame.

See it at:

Anyone know how you could change this from relative to absolute URLS?

I need to be able to cycle through pages on different domains... but can't do that as is.


Brett LaCroix


11:24 am on Jan 7, 2001 (gmt 0)

Inactive Member
Account Expired


hi Brett,

i tested it out on nav4.08 it worked, you can see the changes i made in blue. you may find it too slow, i did, and want to speed it up. if you have any other questions with this feel free to ask.
note:code is for slideshow-left.html
<title>Untitled Document</title>

<!-- Original: Randy Bennett (rbennett@thezone.net) -->
<!-- Web Site: [home.thezone.net...] -->
<!-- Modified by: Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [javascript.internet.com...] -->

<!-- Begin
var repeatshow = 1; // 1 = yes, 0 = no
var timedelay = 15000; // time in milliseconds, 15000 = `15 secs
// be sure to allow enough time for each page to load !!!

here i changed the array element's relative urls to absolute urls.

var page = new Array(
"http://www.food.com" removed comma here
); // note no comma after last page!

// your "the end" page. Necessary if repeatshow = 0;
var endpage = "./index.html"; my index page

var slidenum = 0;
var slidecount = page.length;
var timerID = 0;
var win2;

function showSlideShow() {
if (slidenum < slidecount+1) {
parent.main.location.href = page[slidenum-1];
if (slidenum == slidecount+1) { // if finished
if (repeatshow) {
slidenum = 0;
timerID = setTimeout('showSlideShow()', timedelay)
else parent.main.location.href = endpage;
else timerID = setTimeout('showSlideShow()', timedelay);
// End -->

<body bgcolor="#FFFFFF" onLoad="timerID=setTimeout('showSlideShow()',timedelay)">


1. Open a new page, save it as: slideshow-left.html
2. Copy the coding into the HEAD of slideshow-left.html
3. Add the onLoad code into the BODY of slideshow-left.html
4. Put the BODY coding into the BODY of slideshow-left.html
5. Save the FRAMESET code as slideshow.html -->

<!-- STEP ONE: Create a new page, save as: slideshow-left.html page -->

<!-- STEP TWO: Save this page as slideshow-left.html page -->
<!-- STEP THREE: Insert the onLoad code in slideshow-left.html -->
<!-- STEP FOUR: Copy this code into the BODY of slideshow-left.html -->

here i kept main as a relative url
<a href="./index.html" target="main" onClick="clearTimeout(timerID)"><B>MAIN MENU</B></A><br>
here i changed urls to absolute
<a href="http://www.sewing.com" target="main" onClick="clearTimeout(timerID)">Page One</a><br>
<a href="http://www.beer.com" target="main" onClick="clearTimeout(timerID)">Page Two</a><br>
<a href="http://www.food.com" target="main" onClick="clearTimeout(timerID)">Page Three</a><br><br>
<a href="javascript:showSlideShow();" onClick="clearTimeout(timerID)">Cycle Pages</a><br>

<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>