Experimenting with using JS instead of PHP