I am trying to redirect to a URL path that contains a query parameter called next
, which is itself a URL path that contains a fragment identifier. Here is the JavaScript code I tried:
window.location.href = "/gauth?next=" + window.location.pathname + "#onload=exportToDrive"
Just to make myself clear, the #onload=exportToDrive
should belong to the next
URL path (not the URL that the browser is redirecting to). How can I specify that information to the browser so that it will handle this situation correctly?