Former US president Donald Trump was the target of an assassination attempt at a rally in Pennsylvania on Saturday, days before he was to accept the Republican nomination for a third time.