Hi
This question is for CRM Online version 8.2.
How can I using javascript get a window.location.href parameter? It does not return the same url as I see in the browser.
Thank you.
*This post is locked for comments
Hi
This question is for CRM Online version 8.2.
How can I using javascript get a window.location.href parameter? It does not return the same url as I see in the browser.
Thank you.
*This post is locked for comments
USE:
window.location.replace('http://example.com');
It’s better than using window.location.href = ‘http://example.com’;
Using replace() is better because it does not keep the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco.
You can use assign() and replace methods also to javascript redirect to other pages like the following:
location.assign("">http://example.com");
The difference between replace() method and assign() method(), is that replace() removes the URL of the current document from the document history, means it is not possible to use the “back” button to navigate back to the original document. So Use the assign() method if you want to load a new document, andwant to give the option to navigate back to the original document.
Perfect. Thank you. :-)
Hi ,
Yes it is expected behavior ideally when you are retrieving the url form onload its basically triggering in content page and its depends on where you are triggering javascript method .
You can try to add parent to get the top content URL.
window.parent.location.href
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156