[Javascript] Javascript to change include filename

Paul Novitski paul at juniperwebcraft.com
Wed Jan 21 12:59:22 CST 2009


At 1/21/2009 10:35 AM, Del Wegener wrote:
>One of my websites currently contains the following div
>
>      <div id="blendme">
>           <!--#include file="pic3.txt"-->
>      </div>
>My client wants to have 12 - 20 different pic_ordernn files.  A 
>random number generator should be use decide which file to include 
>(pic1.txt, pic2.txt, pic3.txt, ..., or pic15.txt).
>
>I can write code to randomly create/select one of the filenames but 
>how do I insert that filename in the above include statement?
>
>It seems to me the include is serverside and my JS is client side.
>
>Can that filename be a variable whose value is determined when the 
>page is loaded?
>
>Is this a PHP job?


You're right, the #include directive is executed server-side before 
the page is downloaded, so JavaScript can't help.

You're welcome to contact me off-list if you need PHP assistance.

Regards,

Paul
__________________________

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 




More information about the Javascript mailing list