homepage Welcome to WebmasterWorld Guest from 54.237.77.181
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Selecting different include file for each page load
designer123




msg:3208993
 6:29 am on Jan 5, 2007 (gmt 0)

I need a simple javascript to display a different '.inc' files each time page loads like www.sun.com..
As per my site structure i can't use document.write in js..
I have these images in different .inc files so I need the script which will display different ‘inc’ file every time the page loads.
(simple ad rotator javascript is not working for me – which is for images only not for inc files)
my req is same like sun.com..where u also have next and back buttons to scroll through the images (in my case inc files)..

thanks a lot!

 

korkus2000




msg:3209550
 6:00 pm on Jan 5, 2007 (gmt 0)

These are server side include files?

httpwebwitch




msg:3211880
 8:08 am on Jan 8, 2007 (gmt 0)

This is a classic vanilla implementation of AJAX. Choose the .inc file name randomly from an array of choices. Then load the .inc file with an XMLHttpRequest. Insert the contents of that file onto your page. There are a kajillion tutorials online to teach you how to do this; find one and have fun!

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