Fixing JS features to work in mod.php