Working on a website that is utilizing an unreliable ads provider. Occasionally, the JavaScript code they provide contains bugs, such as changing the background color of the entire body
element instead of just its designated div
. Unfortunately, we are stuck using their service and correction of these errors takes considerable time.
I am considering implementing a solution where a callback function would trigger whenever the background-color
property of the body
element is altered, restoring it to the correct value. Is there an efficient way to achieve this with YUI3 (or jQuery, or vanilla JavaScript if YUI3 lacks the functionality)?
While I am aware of the option to periodically reset the background color using setInterval()
, I find this approach inefficient and messy. Can anyone suggest a more elegant solution?