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

Why if i put ANY javascript on product.tpl it prevents all other javascripts?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-02-2010, 05:15 AM
 
Christofer Christofer is offline
 

eXpert
  
Join Date: Apr 2009
Location: Thessaloniki, Greece
Posts: 202
 

Default Why if i put ANY javascript on product.tpl it prevents all other javascripts?

Hello there, i have a problem (many months ago) but i just released it. In the past i tried to add lightbox to use it on some products. The problem was that when i was adding the lightbox it was preventing the other javascripts from functioning. E.g the prices were not changing if the user choosed an option that has to modify the price.

Qualiteam told me that it was a conflict with the lightbox so i left it. Before a few days i added a script which is:
Code:
window.onload=show; function show(id) { var d = document.getElementById(id); for (var i = 1; i<=20; i++) { if (document.getElementById('answer_q'+i)) {document.getElementById('answer_q'+i).style.display='none';} } if (d) {d.style.display='block';} }

but even with that code i have again the same problems. Even if i added it with external .js. Any ideas what's going on?
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql)
Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server
Modules : X-Offer & X-Aom & One page checkout
Product tabs & Product downloads & many more
Reply With Quote
  #2  
Old 02-02-2010, 11:12 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Why if i put ANY javascript on product.tpl it prevents all other javascripts?

If you are having issues with several javascript initializations conflicting with each other - you might find the methods described here useful: http://www.dyn-web.com/tutorials/combine.php
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 02-02-2010, 12:22 PM
 
Christofer Christofer is offline
 

eXpert
  
Join Date: Apr 2009
Location: Thessaloniki, Greece
Posts: 202
 

Default Re: Why if i put ANY javascript on product.tpl it prevents all other javascripts?

thank you, ill check it but basically qualiteam told that it was a conflict with the lightbox coz of the sign $, but i believe that they are not true because:
1. on many xcart sites i saw lightbox
2. the problem appears with ANY javascript i add, so i don't think it has to do with the code that the javascripts i add, but with the javascript at all..
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql)
Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server
Modules : X-Offer & X-Aom & One page checkout
Product tabs & Product downloads & many more
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 09:57 AM.

   

 
X-Cart forums © 2001-2020