homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
HELP.. Need to change Javascript...
From relative to absolute URLS
BrettLaCroix

10+ Year Member



 
Msg#: 141 posted 8:26 am on Jan 7, 2001 (gmt 0)

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:
[javascript.internet.com...]

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.

Thanks,

Brett LaCroix

 

mousemoves

10+ Year Member



 
Msg#: 141 posted 11:24 am on Jan 7, 2001 (gmt 0)

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
<html>
<HEAD>
<title>Untitled Document</title>

<SCRIPT LANGUAGE="JavaScript">
<!-- 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.sewing.com",
"http://www.beer.com",
"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() {
slidenum++;
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 -->
</script>
</HEAD>

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

<!-- FIVE STEPS TO INSTALL WEB SLIDESHOW:

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 -->

<center>
here i kept main as a relative url
<a href="./index.html" target="main" onClick="clearTimeout(timerID)"><B>MAIN MENU</B></A><br>
<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>
</center>

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved