You can't, but in order to not make the trip to the Opportunity page useless you could have a subgrid in the Opportunity form that users see immediately that displays the new contact or account you just created.
If you're looking to go through the JS route, then I would hide all sections on a form and place the subgrid or the Lookup fields of both account and contact right at the very top along with a message saying "Account or Contact Created".
It's a crankier system but for true CRM systems this is typically the process. What you're trying to do is something more XRM.