Forum Moderators: open

Message Too Old, No Replies

Selecting different include file for each page load

         

designer123

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



These are server side include files?

httpwebwitch

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

WebmasterWorld Senior Member 10+ Year Member



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!