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

Some pages stripping .js

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-21-2015, 08:06 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Some pages stripping .js

I have a custom navigation for mobile users. I call a .js file in the AView class that works great. But, there two or three pages that it strips the .js file and no css is rendered.

Is there a reason some categories or pages would strip or not include the .js file?

thanks.
__________________
V5.2.13
Reply With Quote
  #2  
Old 05-21-2015, 08:42 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Some pages stripping .js

Could it be that some pages are not calling jquery? I see my .js file in the code but it doesn't work on some pages... others it works great.
__________________
V5.2.13
Reply With Quote
  #3  
Old 05-21-2015, 09:05 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Some pages stripping .js

It your js file relies on jQuery and jQuery is not loaded you will get an error - check the console errors - Firebug or Inspect Element

I would think jQuery loads on all pages since cart relies on it everywhere
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 05-21-2015, 10:10 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Some pages stripping .js

I only see the following error:

Uncaught Error: cannot call methods on draggable prior to initialization; attempted to call method 'disable'

It is in the jquery.min.js file.
__________________
V5.2.13
Reply With Quote
  #5  
Old 05-21-2015, 10:19 AM
 
cvaughan02 cvaughan02 is offline
 

Member
  
Join Date: Mar 2014
Location: st. louis, mo
Posts: 22
 

Default Re: Some pages stripping .js

Quote:
Originally Posted by skit
I only see the following error:

Uncaught Error: cannot call methods on draggable prior to initialization; attempted to call method 'disable'

It is in the jquery.min.js file.


probably means that one of your installed modules is attempting to use draggable and you have it turned off (it allows users to drag items to the cart). we had this issue with call for price module attempting to disable dragging in default>en>modules>qsl>callforprice>itemslist>prod uct (I'm typing from memory.. could be wrong). Perhaps the pages where you're getting this error have products on them that are set to call for price?
__________________
SEEK HAPPINESS. EVERYTHING ELSE IS DETAILS.
Reply With Quote
  #6  
Old 05-21-2015, 10:22 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Some pages stripping .js

The "Call For Price" module is installed and that particular page does have it in use. What was the fix?
__________________
V5.2.13
Reply With Quote
  #7  
Old 05-21-2015, 10:32 AM
 
cvaughan02 cvaughan02 is offline
 

Member
  
Join Date: Mar 2014
Location: st. louis, mo
Posts: 22
 

Default Re: Some pages stripping .js

Quote:
Originally Posted by skit
The "Call For Price" module is installed and that particular page does have it in use. What was the fix?


I don't have it in front of me right now, but i can tell you the basic idea. if you know how to overwrite templates it should be fairly straight forward.

you need to, in your own module, overwrite that file. so create (path to your modules skin)/default/en/modules/qsl/callforprice/itemlist/product/disable_dragging.js.

copy the contents of their file to your file and then just comment out that line. that should work.
__________________
SEEK HAPPINESS. EVERYTHING ELSE IS DETAILS.
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 07:26 AM.

   

 
X-Cart forums © 2001-2020