Developer forum

Forum » Templates » Problem with filters.js

Problem with filters.js

Per Ljung
Reply

Hi!

I'm using the functions for sorting products in a list from the SolutionSet. But I can't make in work because I get an error in the file filters.js saying that $.query is undefined. I know I have place the script tag for referring to jquery before the script tag for referring to filters.js, but somehow jQuery isn't loaded.

Any ideas?

Regards,

Per


Replies

 
Morten Bengtson
Reply

$.query is not part of jQuery, but is provided by a plugin. Make sure you have references to all required js files.

You probably need to add the following references:

<script src="/Files/Templates/Designs/eCommerce01_responsive/assets/vendors/require-jquery.js"></script>
<script src="/Files/Templates/Designs/eCommerce01_responsive/assets/js/start.js"></script>

These two scripts ensures that jquery plugins are loaded on the pages where they are needed.

Note: require-jquery.js includes jquery. You can find the documentation for requirejs at http://requirejs.org/docs/jquery.html

You can see a working example here: http://solutionset.dynamicweb.dk/en-US/Products.aspx?eComQuery=bike

 
Per Ljung
Reply

Hi!

I have downloaded and referenced these two files, but still get the error that $.query is undefined when calling $.query.get(keys[i]) on row 109 in filters.js.

Regards,

Per

 
Morten Bengtson
Reply

Without a link to the page I'm not able to say what the problem is, but make sure there are no other errors (404 not found etc.) and try to remove references to other js files (if any), so that you only reference require-jquery.js and start.js. The filters.js file is loaded by requirejs, so you don't need to reference it in the template.

BTW: I assume that you are using the responsive version of solution set. If that is not the case then please ignore everything I have written here. I recommend that you contact Dynamicweb support for futher assistance.

 
Per Ljung
Reply

Solved.

Was missing reference to jquery.query.js.

 

/Per

 

You must be logged in to post in the forum