I want to get/set URL of the current page upon certain event.
It seems there are more than one approach for doing it as mentioned in questions/answers below.
Using Jquery
Get URL - $(location).attr('href');
Set URL - $(location).attr('href',url);
Using JavaScript
Get URL - myVar = window.location.href;
Set URL - window.location.href = "http://stackoverflow.com";
Which approach works across space-time-browsers-versions?