Guest Posted January 10, 2007 Share Posted January 10, 2007 I was wondering if it is possible to use this javascript in my index.php? I want to use it at /home/tokyospe/public_html/includes/languages/english.index.php The script is meant to select images randomly. And if I can... where do I insert it. Because I would like to see it between my define('TEXT_MAIN') and my define('TABLE_HEADING_NEW_PRODUCTS') Also, if it works, which directory should I upload my images to? [code]<script language="JavaScript"> image = new Array image[1]="splash_aem.jpg" image[2]="splash_cusco.jpg" image[3]="splash_defi.jpg" image[4]="splash_exedy.jpg" image[5]="splash_hasport.jpg" image[6]="splash_jic.jpg" image[7]="splash_skunk2.jpg" image[8]="splash_spoon.jpg" image[9]="splash_sun.jpg" image[10]="splash_tanabe.jpg" image[11]="splash_tein.jpg" random_num = (Math.round((Math.random()*10)+1)) document.write("<img src=\"" + image[random_num] + "\">"); </script> Link to comment Share on other sites More sharing options...
jpweber Posted January 10, 2007 Share Posted January 10, 2007 Yes, you can use it. What are you trying to accomplish? What's your URL and explain what you're trying to accomplish. When it comes to actual coding: image[1]="splash_aem.jpg" image[2]="splash_cusco.jpg" image[3]="splash_defi.jpg" image[4]="splash_exedy.jpg" image[5]="splash_hasport.jpg" image[6]="splash_jic.jpg" image[7]="splash_skunk2.jpg" image[8]="splash_spoon.jpg" image[9]="splash_sun.jpg" image[10]="splash_tanabe.jpg" image[11]="splash_tein.jpg" You'll change to: image[1]="images/splash_aem.jpg" image[2]="images/splash_cusco.jpg" image[3]="images/splash_defi.jpg" image[4]="images/splash_exedy.jpg" image[5]="images/splash_hasport.jpg" image[6]="images/splash_jic.jpg" image[7]="images/splash_skunk2.jpg" image[8]="images/splash_spoon.jpg" image[9]="images/splash_sun.jpg" image[10]="images/splash_tanabe.jpg" image[11]="images/splash_tein.jpg" And you'll upload your jpg files to your (catalog)/images folder. But I'm not sure precisely what you're trying to accomplish. Jason Simple 1-2-3 Intructions on how to get, install and configure SSL The Google Sandbox explained Simple to follow instructions on how to change the look of your OSC How To Make A Horrible OSC Website my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.