Changed php to javascript