Fixed a problem with running js code

Fixed js code not run in any page but the ROOT page