Migrate site to use JavaScript instead of PHP