Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How do I add Javascript?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 07-31-2008, 02:16 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

ok, pasted:
<HEAD>
<script language="JavaScript" src="../scripts/dhtmllib.js"></script>
<script language="JavaScript" src="../scripts/scroller.js"></script>
</head>

Still can't get the marquee to show. There is something in the code breaking the page.
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #22  
Old 07-31-2008, 02:17 PM
 
Group Imaging Group Imaging is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 38
 

Default Re: How do I add Javascript?

does it give any errors or is it a totally blank page?
__________________
Brad Thompson
Group Imaging
X-Cart Gold Version 4.1.8
Reply With Quote
  #23  
Old 07-31-2008, 02:28 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

everything coded after what I paste is gone. This includes the right side column.
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #24  
Old 07-31-2008, 02:42 PM
 
Group Imaging Group Imaging is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 38
 

Default Re: How do I add Javascript?

Oh! Totally forgot..... try this:

{literal}
javascript here
{/literal}

You probably need to add those literal tags before and after your code.
__________________
Brad Thompson
Group Imaging
X-Cart Gold Version 4.1.8
Reply With Quote
  #25  
Old 07-31-2008, 03:20 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

Inserted the literal tag, still not working...I"m at a loss for what to do.
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #26  
Old 08-06-2008, 12:01 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

Quote:
Originally Posted by Group Imaging
If you still aren't sure maybe you could post the code from customer/home.tpl

Here is the homepage.tpl

{*-----BEGIN SCROLLING MARQUEE---------
<table width="100%"><tr>
<td align="center">
<div id="tempholder"></div>
<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="scroller.js"></script>
<script language="JavaScript">
/*
Mike's DHTML scroller (By Mike Hall)
Last updated July 21st, 02' by Dynamic Drive for NS6 functionality
For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com
*/
//SET SCROLLER APPEARANCE AND MESSAGES
var myScroller1 = new Scroller(0, 0, 480, 100, 1, 5); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#006699", "#FFFFFF", "#efefef"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
myScroller1.addItem("<p align='center'><b>The all new Rip Curl E-Bombs are here!</b><br>E3: The third generation of Elastomax Superstretch Neoprene. Lighter, Warmer and More Flexible.</p>");
myScroller1.addItem("<p align='center'><b>Patagonia Wetsuits! Coming this fall!</b> <br>The arrival is quickly approaching┘ Cleanlinesurf is one of only 10 US authorized dealers. Check out the construction here.</p>");
myScroller1.addItem("<p align='center'><b>The all new F-Bombs are here!</b><br>Rip Curl F-Bomb Hooded Wetsuits with Fireskin lining! New and improved for Fall 08. Still the warmest available.</p>");
myScroller1.addItem("<p align='center'><b>On Sale Now:</b><br>&bull; O'neill Hammer 3/2 - $99.96<br>&bull; Billabong Foil GBS - $103.16<br>&bull; Billabong Foil FL - $77.56</p>");
//SET SCROLLER PAUSE
myScroller1.setPause(3000); //set pause beteen msgs, in milliseconds
function runmikescroll() {
var layer;
var mikex, mikey;
// Locate placeholder layer so we can use it to position the scrollers.
layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);
// Create the first scroller and position it.
myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}
window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:480; height:100px;">
-----END SCROLLING MARQUEE---------------------------*}
<table width="100%" align="center">
<tr>
<td align="center"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="home.php?cat=2091"><img src="images/manufacture_01-nixon.jpg" width="133" height="66" border="0" alt="Nixon Watches" /></a></td>
<td><a href="home.php?cat=614"><img src="images/manufacture_02-oneill.jpg" width="133" height="66" border="0" alt="Oneill Wetsuits" /></a></td>
<td><a href="home.php?cat=2019"><img src="images/manufacture_21-future.gif" width="133" height="66" border="0" alt="Future Fins, surfboard, fins" /></a></td>
</tr>
<tr>
<td>
<a href="javascriptpenNewWindow('http://www.patagonia.com/usa/popup/media_gallery_photo.jsp?OPTION=SAR&assetid=18490', 'thewin','height=530,width=600, toolbar=no,scrollbars=yes')">
<img src="images/manufacture_00-patagonia.jpg" alt="Patagonia Coming Soon!" width="133" height="66" border="0" /></a></td>
<td><a href="home.php?cat=667"><img src="images/manufacture_05-ripcurl.jpg" width="133" height="66" border="0" alt="Rip Curl Wetsuits, Watches" /></a></td>
<td><a href="home.php?cat=904"><img src="images/manufacture_06-gsi.jpg" width="133" height="66" border="0" alt="GSI, Global Surf Industries" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1864"><img src="images/manufacture_07-firewire.jpg" width="133" height="66" border="0" alt="Firewire Surfboards" /></a></td>
<td><a href="home.php?cat=662"><img src="images/manufacture_08-quiksilver.jpg" width="133" height="66" border="0" alt="Quiksilver Wetsuits" /></a></td>
<td><a href="home.php?cat=2020"><img src="images/manufacture_09-fcs.jpg" width="133" height="66" border="0" alt="FCS, Surfboard Fins" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1311"><img src="images/manufacture_10-billabong.jpg" width="133" height="66" border="0" alt="Billabong Wetsuits" /></a></td>
<td><a href="home.php?cat=1029"><img src="images/manufacture_11-sector9.jpg" width="133" height="66" border="0" alt="Sector 9, Sector nine, skateboards, longboards" /></a></td>
<td><a href="home.php?cat=1517"><img src="images/manufacture_12-arnette.jpg" width="133" height="66" border="0" alt="Arnette Sunglasses" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=692"><img src="images/manufacture_13-roxy.jpg" width="133" height="66" border="0" alt="Roxy Women Wetsuits" /></a></td>
<td><a href="home.php?cat=456"><img src="images/manufacture_14-vestal.jpg" width="133" height="66" border="0" alt="Vestal Watches" /></a></td>
<td><a href="home.php?cat=1297"><img src="images/manufacture_15-dakine.jpg" width="133" height="66" border="0" alt="Dakine accessories" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=2"><img src="images/manufacture_16-oakley.jpg" width="133" height="66" border="0" alt="Oakley Sunglasses" /></a></td>
<td><a href="home.php?cat=1981"><img src="images/manufacture_17-arbor.jpg" width="133" height="66" border="0" alt="Arbor longboards, skateboards" /></a></td>
<td><a href="home.php?cat=1661"><img src="images/manufacture_18-vonzipper.jpg" width="133" height="66" border="0" alt="Von zipper sunglasses" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1165"><img src="images/manufacture_04-spy.jpg" width="133" height="66" border="0" alt="Spy Sunglasses" /></a></td>
<td><a href="home.php?cat=1024"><img src="images/manufacture_03-ugg.jpg" width="133" height="66" border="0" alt="UGG boots" /></a></td>
<td><a href="home.php?cat=1980"><img src="images/manufacture_20-grain.gif" width="133" height="66" border="0" alt="Grain Surfboards" /></a></td>
</tr>
<tr>
<td><a href="http://www.cleanlinesurf.com/manufacturers.php?manufacturerid=40"><img src="images/manufacture_22-burton.jpg" alt="Burton" width="133" height="66" border="0" /></a></td>
<td><a href="https://www.cleanlinesurf.com/manufacturers.php?manufacturerid=46"><img src="images/manufacture_19-sitka.gif" width="133" height="66" border="0" alt="Sitka Clothing" /></a></td>
<td><a href="https://www.cleanlinesurf.com/manufacturers.php?manufacturerid=14"><img src="images/manufacture_23-hotline.gif" width="133" height="66" border="0" alt="hotline wetsuits"/></a></td>
</tr>
</table></td>
</tr>
</table>
<br />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="{$ImagesDir}/newmenu_01.gif"><img src="images/space.gif" width="14" height="22" /></td>
<td background="{$ImagesDir}/newmenu_02.gif"><img src="images/space.gif" width="4" /><font color="#990000">Welcome to Cleanlinesurf.com!</font></td>
<td background="{$ImagesDir}/newmenu_03.gif"><img src="images/space.gif" width="14" height="22" /></td>
</tr>
<tr>
<td background="{$ImagesDir}/newmenu_04.gif"><img src="images/space.gif" width="14" height="100%" /></td>
<td>We are a full service surf shop located on the Northern Oregon Coast. Established in 1980 and locally owned and operated, Cleanline is The Northwest's &quot;Original&quot; Surf Shop. We carry the Northwest's largest selection of surfboards &amp; wetsuits, as well as a wide selection of quality, cutting edge gear to suit your lifestyle.
<p>Our goal is to provide you with the best shopping experience possible. Our friendly knowledgeable staff is here to serve you. If you are looking for something special that you don't see on our site, please give us a call: Toll Free at (88 546-6176 or International at (503) 738-2061. Thanks for shopping at Cleanlinesurf.com!</p>
<p align="justify">&nbsp;</p>
</td>
<td background="{$ImagesDir}/newmenu_06.gif"><img src="images/space.gif" width="14" height="100%" /></td>
</tr>
<tr>
<td background="{$ImagesDir}/newmenu_07.gif"><img src="images/space.gif" width="14" height="14" /></td>
<td background="{$ImagesDir}/newmenu_08.gif"><img src="images/space.gif" width="100%" height="14" /></td>
<td background="{$ImagesDir}/newmenu_09.gif"><img src="images/space.gif" width="14" height="14" /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td width="100%" align="center"></td>
</tr>
</table>
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #27  
Old 08-06-2008, 02:08 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

Ok so I'm going another direction to add this little scroller. Here's the code I've written:

{literal}<iframe src="../mikescroll/scrolling_marque.html" width="480" height="100" align="center" scrolling="no" frameborder="0"></iframe>{/literal}

This includes my html file I made, that works correctly, but right now it loads up the customer index page. What is the correct way to point to my file?

The file is located: skin1/customer/main/mikescroll/scrolling_marque.html


Maybe I need to make a static page and call it? How would I write that using the code above?
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #28  
Old 08-06-2008, 02:40 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

So I'm able to make the scroller work on a static page, now how do I insert this static page into the index page? I don't want to use the include function, because it won't align where I want, so I'm thinking iframe, but my iframe code isn't pulling the correct page. I have literal brackets, still no go...
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #29  
Old 08-06-2008, 05:02 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: How do I add Javascript?

Take a look at customer/main/welcome.tpl. It is what puts the "Welcome to..." at the start of the center section of the home page.... is that where you want your marquee?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #30  
Old 08-06-2008, 10:33 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: How do I add Javascript?

I want the marquee to be placed just below the "Welcome to..."
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:09 AM.

   

 
X-Cart forums © 2001-2020