What issue are you having with window.location.href
? That is what I use to get the page URL and I don't recall ever having issues.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I need to get full page Url address in SPFx using No JavaScript Framework.
tried with location.href but no proper url structure
What issue are you having with window.location.href
? That is what I use to get the page URL and I don't recall ever having issues.
Hi @Ravindranath M ,
Per my test, I agree with RobWindsor-4651's function to get current page url. It works well. You can try the code in the answer. If there is any issue, you can provide the error message for further
test.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.