Fix to remove the js error when opening/closing frames.

TypeError: undefined is not an object (evaluating 'val.replace')
These js files are still included unless they are
comment out with //- or completly removed.
They should not be there in the first place.
Affects browser < 2.2.
Merge pull request #3129 from oskarhane/fix_replace_js_error

[2.0] Browser: Fix to remove the js error when opening/closing frames.