[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
- The topic ‘[Plugin: Share and Follow] Javascript bug’ is closed to new replies.