index.php:changeCode function with javascript