Missing JS concatenation operator causes error
-
Hi Fahad,
A client of mine uses your plugin. While running a backup with BackupBuddy, it reported a JS error:
And in Chrome’s Developer Console:
Looking at
wpdp_auto_script.js
, lines 52 and 53 are missing the+
concatenation operator:if ($('input[data-original_id='datum']').val()!= "") { $('input[data-original_id='datum']').attr('data-default-val', $('input[data-original_id='datum']').val()); }
Apart from these three instances, there have been three more on lines 154 and 155.
Changing it to the following got rid of the error:
if ($('input[data-original_id=' + datum + ']').val()!= "") { $('input[data-original_id='+ datum + ']').attr('data-default-val', $('input[data-original_id='+ datum + ']').val()); }
You can find the full fixed content of
wpdp_auto_script.js
here.Also, consider minifying your JavaScript and only execute it on pages where it’s actually needed to prevent conflicts.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Missing JS concatenation operator causes error’ is closed to new replies.