Last frustration for tonight i hope
i created the function below
function findReplace(find,replace,html) {
html = html.replace( find/g, replace ); //(/blue/gi, "red");
return html;
}
where find is a variable
i want to change every time the variable is found
normally with just one word this works with (/blue/g, "red");
but when i replace blue with find the variable becomes fixed... mwaaa
i guess i have to do something with // \ /\ / but no matter what i try i get errors and in google i use or the wrong search tag or there is no answer...
How does this needs to be done?