update async snippet

update JavaScript async snippet for consistency with current Facebook snippet