Title: Javascript Error on Filters
Last modified: August 31, 2016

---

# Javascript Error on Filters

 *  Resolved [tommcgee](https://wordpress.org/support/users/tommcgee/)
 * (@tommcgee)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-on-filters/)
 * When I set up a filter for the card view, nothing happens on selection. The console
   shows “Uncaught ReferenceError: label is not defined.”
 * The function in question seems to be here:
 *     ```
       (function(obj,_
       /**/) {
       var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
       with(obj||{}){
       __p+='Filter options for '+
       ((__t=(label))==null?'':__t)+
       '';
       }
       return __p;
   
       })
       ```
   
 * See:
    [http://blogs.shu.edu/tomstest/dhp-projects/concert-history/?viz=0#](http://blogs.shu.edu/tomstest/dhp-projects/concert-history/?viz=0#)
 * Or:
    [http://blogs.shu.edu/tomstest/dhp-projects/grove-road-take-2/?viz=1#](http://blogs.shu.edu/tomstest/dhp-projects/grove-road-take-2/?viz=1#)
 * [https://wordpress.org/plugins/dh-press/](https://wordpress.org/plugins/dh-press/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [tommcgee](https://wordpress.org/support/users/tommcgee/)
 * (@tommcgee)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-on-filters/#post-7388528)
 * More specifically, it could be the updated version of underscores in WP 4.5. 
   It changed the .template function so that it returns a function instead of a 
   variable, but the DH Press function that calls it is looking for a variable.
 *     ```
       var labelText = dhpServices.compileText('#dhp-script-lbl-filter', { label: dhpCardsView.currentFilter });
       ```
   
 * in dhp-cards-view.js line 234.
 *  Thread Starter [tommcgee](https://wordpress.org/support/users/tommcgee/)
 * (@tommcgee)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-on-filters/#post-7388534)
 * Partial fix. Modify /wp-content/plugins/dh-press/js/dhp-services.js
 * Line 1010 change
 *     ```
       var template = _.template(baseText, vars);
       return template;
       ```
   
 * to
 *     ```
       var template = _.template(baseText);
       return template({'label':vars.label});
       ```
   
 * That addresses getting the filters up and running again. There’s still an issue
   with making the contents of #legends change/function.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Javascript Error on Filters’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dh-press.svg)
 * [DH Press - Digital Humanities Toolkit](https://wordpress.org/plugins/dh-press/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dh-press/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dh-press/)
 * [Active Topics](https://wordpress.org/support/plugin/dh-press/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dh-press/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dh-press/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [underscore](https://wordpress.org/support/topic-tag/underscore/)

 * 2 replies
 * 1 participant
 * Last reply from: [tommcgee](https://wordpress.org/support/users/tommcgee/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-on-filters/#post-7388534)
 * Status: resolved