WPIntell

Source evidence

Javascript Error, background_color not declared

Ultimate Under Construction · support · 2015-04-15T13:12:00+00:00

mixedsentiment
mediumseverity
0.78relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 21 rows with source links

9.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
aryanduntley resolved
On about line 19 of uuc-script.js inside of function toggle_text(), you need to declare the variable background_color with var and after that, you need to check if the .val() value of the object exists before checking for what it contains. With one of my clients I am using the Avada theme along with this plugin until launch and this plugin’s javascript is breaking the js in the Avada edit page. I replaced the code around line 19, start of toggle_text() with this: var background_color = $(‘#background-color’); if(background_color.val() == undefined || ” === background_color.val().replace(‘#’, ”)) { https://wordpress.org/plugins/ultimate-under-construction/ Furthermore, I do not believe this script should be getting called in the edit post page, it may be (I haven’t checked your plugin’s use enough, I just activated it and am using all default stuff), but it doesn’t seem likely. You may want to think about adding the script only when in its settings page or !is_admin(). Hi, You are completely correct! Thank you so much for pointing this out to me! I have switched out with your snippet of code above and have tweaked scripts.php. This will be included with the next update I am working on. Thanks, Mike Sure thing.

Comments

3 shown
aryanduntley 2015-04-15T13:15:00+00:00

Furthermore, I do not believe this script should be getting called in the edit post page, it may be (I haven’t checked your plugin’s use enough, I just activated it and am using all default stuff), but it doesn’t seem likely. You may want to think about adding the script only when in its settings page or !is_admin().

Mike Morrow 2015-04-24T10:54:00+00:00

Hi, You are completely correct! Thank you so much for pointing this out to me! I have switched out with your snippet of code above and have tweaked scripts.php. This will be included with the next update I am working on. Thanks, Mike

aryanduntley 2015-04-24T11:15:00+00:00

Sure thing.