Title: [Plugin: Share and Follow] Javascript bug
Last modified: August 20, 2016

---

# [Plugin: Share and Follow] Javascript bug

 *  anonymized-3457723
 * (@anonymized-3457723)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-share-and-follow-javascript-bug/)
 * The plugin causes an error in that it produces wrong javascript. It produces:
 *     ```
       function tabAction(){
             if (jQuery(window).width() <= 100px ){ <<<<<<<<<<<< This is not correct and should be <= 100
       ```
   
 * The error is caused by line 1298 in share-and-follow.php:
 * `if (jQuery(window).width() <= <?php echo $devOptions['width_of_page_minimum'];?
   > ){`
 * I’m not quite sure how to fix this. Entering the value hardcoded obviously is
   not an option. A string-operation also seems awkward as a fix. This is best be
   fixed in a next release I think unless someone has a correct solution.
    … Okay
   I decided to fix this with a string operation that takes of the ‘px’. In share-
   and-follow.php I added
 * // we need a fix otherwise $devOptions[‘width_of_page_minimum’] outputs a string,
   which causes a javascript error
    $min_page_width = substr($devOptions[‘width_of_page_minimum’],
   0, -2);
 * on line 1293 after wp_enqueue_script(‘jquery’);
 * Then in the outputted javascript I now have
 * if (jQuery(window).width() <= <?php echo $min_page_width; ?> ){
 * on line 1300
 * Any comments or better solutions are still welcome.
 * John
 * [http://wordpress.org/extend/plugins/share-and-follow/](http://wordpress.org/extend/plugins/share-and-follow/)

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

 *  Plugin Author [andykillen](https://wordpress.org/support/users/andykillen/)
 * (@andykillen)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-share-and-follow-javascript-bug/#post-2469744)
 * John,
 * is it because you have added the px to the end of the field in the admin screen
   that it is using px?
 * regards
    Andy
 *  Thread Starter anonymized-3457723
 * (@anonymized-3457723)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-share-and-follow-javascript-bug/#post-2469745)
 * Stupid indeed. That was it 😉 Tnx for replying.

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

The topic ‘[Plugin: Share and Follow] Javascript bug’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/share-and-follow.svg)
 * [Share and Follow](https://wordpress.org/plugins/share-and-follow/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/share-and-follow/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/share-and-follow/)
 * [Active Topics](https://wordpress.org/support/plugin/share-and-follow/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/share-and-follow/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/share-and-follow/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: anonymized-3457723
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-share-and-follow-javascript-bug/#post-2469745)
 * Status: not resolved