Question

I need to add items to a SharePoint list using client object model. The issue I am facing is: Suppose I am at a page whose URL is http'://sharepointserver:7575/details.aspx

I want to fetch this complete URL & Similarly I need to fetch the current page name also using client object model. Can someone please guide me Which properties I can use to achieve this as I don't have any idea about client object model coding?

Any help would be greatly appreciated..

Was it helpful?

Solution

Try to use window.location.href to get full request url and window.location.pathname.substring(window.location.pathname.lastIndexOf("/") + 1); to get page name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top