Hello _spPageContextInfo!!!
I found this little gem by viewing the source of my site spdwiki.com. Simply running a console.dir() on this object reveals these properties:
I've noticed running this same inquiry on a different site, say http://www.sharepointfabian.com, the properties are different:
It's safe to say, this is because the latter is a blog and not a wiki.
What to make of all of this? I'm able to display pertinent data accordingly and no longer required to rely on the text of the page name.
var pageID = _spPageContextInfo.pageItemId;
It's a much cleaner solution that just feels good.
I've been working on a commenting system for a SharePoint 2010 system. Knowing some of these internal variables that are floating around is invaluable. Hope you find this useful as well.
Yes Josh, I'm going to finish this finally. ;-)
I found this little gem by viewing the source of my site spdwiki.com. Simply running a console.dir() on this object reveals these properties:
I've noticed running this same inquiry on a different site, say http://www.sharepointfabian.com, the properties are different:
It's safe to say, this is because the latter is a blog and not a wiki.
What to make of all of this? I'm able to display pertinent data accordingly and no longer required to rely on the text of the page name.
var pageID = _spPageContextInfo.pageItemId;
It's a much cleaner solution that just feels good.
I've been working on a commenting system for a SharePoint 2010 system. Knowing some of these internal variables that are floating around is invaluable. Hope you find this useful as well.
Yes Josh, I'm going to finish this finally. ;-)
1 comment:
About time!!! ;-)
Post a Comment