Search engine

Question by chris wick:
How to change a Javascript File (.js file) with external values?

I need the code for the Javascript file that would enable it to be change with out chaning the JS file like Google adsense goes.
I just need it to change the background colour.

Example Code:


Thanks, Chris


——————————————

Answer by dhvrm
You need to know the variable in the external JS file that holds the background color. That variable needs to have global scope.

Assuming you properly identify the variable with global scope that holds the value, then you can simply reassign its value inb your JavaScript.

You then need to ensure no other functions or statements in the external JS file reassign the value to the background color variable.

——————————————
Know better? Leave your own answer in the comments!