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

Removing Javascript

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-02-2008, 05:21 AM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Removing Javascript

Does this js need to be in the header?
<script type="text/javascript">
<!--
var number_format_dec = '.';
var number_format_th = '';
var number_format_point = '2';
var store_language = 'US';
var xcart_web_dir = "";
var images_dir = "/skin1/images";
var lbl_no_items_have_been_selected = 'No items have been selected';
var current_area = 'C';
-->If so where is it at to link to it instead of it being on each page? I have tried to remove it and link to it but I get errors.
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote
  #2  
Old 04-02-2008, 05:41 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Removing Javascript

Yes, you need it and it has to stay visible.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 04-29-2008, 05:48 PM
  BunnyburyBaby's Avatar 
BunnyburyBaby BunnyburyBaby is offline
 

Advanced Member
  
Join Date: Nov 2007
Location: Los Angeles
Posts: 32
 

Default Re: Removing Javascript

can this script be moved from presets_js.tpl to a .js file to remove it from the head html? If we have a site that only sells in the US, one language and one user type? Can we hard code it like this:

old code:
Code:
<script type="text/javascript"> <!-- var number_format_dec = '{$number_format_dec}'; var number_format_th = '{$number_format_th}'; var number_format_point = '{$number_format_point}'; var store_language = '{$store_language}'; var xcart_web_dir = "{$xcart_web_dir}"; var images_dir = "{$ImagesDir}"; var lbl_no_items_have_been_selected = '{$lng.lbl_no_items_have_been_selected|escape:javascript}'; var current_area = '{$usertype}'; --> </script>

new code stored in a whateveryounameit.js file
Code:
<script src=" http://mysite.com/whateveryounameit.js" type="text/javascript"></script>

and have the whateveryounameit.js file contain the following:
Code:
var number_format_dec = '.'; var number_format_th = ''; var number_format_point = '2'; var store_language = 'US'; var xcart_web_dir = ""; var images_dir = "/skin1/images"; var lbl_no_items_have_been_selected = 'No items have been selected'; var current_area = 'C';

What are the limitations?

Thanks a bunch!
bunnyburybaby
__________________
X-Cart Version 4.1.8
Reply With Quote
  #4  
Old 04-30-2008, 09:07 AM
  BunnyburyBaby's Avatar 
BunnyburyBaby BunnyburyBaby is offline
 

Advanced Member
  
Join Date: Nov 2007
Location: Los Angeles
Posts: 32
 

Default Re: Removing Javascript

If it can be placed in a static form in an external .js file, could it be placed in the /skin1/common.js file?
__________________
X-Cart Version 4.1.8
Reply With Quote
  #5  
Old 05-15-2008, 04:44 PM
  HumanNature's Avatar 
HumanNature HumanNature is offline
 

Member
  
Join Date: Aug 2006
Posts: 26
 

Default Re: Removing Javascript

Quote:
Originally Posted by balinor
Yes, you need it and it has to stay visible.

Sorry to ask about it (maybe a silly question) but I have just removed the content of this template (in a test site) and my cart seems to work perfect.

Which is the problem about deleting this JS?

Yours
__________________
X-Cart 4.1.5
PHP 4.3.9
Mysql 4.1
VPS CentOS 4.2
Mods: Too much...
* Moving to 4.1.8 and to a dedicated server *
Reply With Quote
  #6  
Old 06-30-2008, 05:18 AM
 
Cefko Cefko is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 69
 

Default Re: Removing Javascript

Any conclusion to this? Can it be removed safely?
__________________
X-cart version 4.1.7
Apache/2.0.52 (CentOS)
My SQL 5.0.58
PHP Version 5.1.6
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 02:54 PM.

   

 
X-Cart forums © 2001-2020