Share via


SP.File.serverRelativeUrl Property

Applies to: SharePoint Foundation 2010

In this article
Property Value
Applies To
Remarks

Gets the relative URL of the file based on the URL for the server.

var value = SP.File.get_serverRelativeUrl(); 

Property Value

Type: String

Applies To

SP.File Class

Exceptions

Remarks

The ServerRelativeUrl property returns a string in the following form, which excludes the name of the server or root folder: /Site_Name/Subsite_Name/Folder_Name/File_Name.

It must not be null. It must be a URL of server relative form.

See Also

Reference

SP.File Methods

SP.File Properties

SP Namespace