I need NewForm.aspx page redirects to custom page on item added to list. I've done this by changing Source parameter in URL after NewForm.aspx has been loaded. But it makes the page to load twice. Is there a way to change Source without page reload?
The answer to the question is No. After the page has been loaded and sent to the browser, there is no way to change the query string without reloading the page. Browsers only allow the part of the URL after "#" to be changed: http://authority/path?que=ry&str=ing#anchor
You can either move the dynamic code earler (modify the link to the new form) or later (set the source parameter to target a custom page - let the custom page have dynamic code that redirects dynamically based on the system state). Can you tell us more about the requirement?