use ajax to update-snippet