use JS function call instead of POST method