using javascript instead of php