- Assigning object literal properties
var foo = { bar : 'hello'}; - Ternar
var cats = happy ? "yes" : "no"; var cats = happy ? "yes" : "no"; - Denote the
outer_loop: for(i=0; i<3; i++) operator outer_loop: for(i=0; i<3; i++) - What else?
I am scrolling through a sharepoint 2010 file and I continue to work in this syntax
someFunction: ;
For example, there is a file in which the following function is declared at the top:
function ULSqvN() { var o = new Object; o.ULSTeamName = "SharePoint Portal Server"; o.ULSFileName = "SocialData.js"; return o; }
and then in the file we find the following
PageUrlNormalizer = function () { ULSqvN: ; //<---------------- This guy here -------------------------- try { this._url = _normalizedPageUrlForSocialItem } catch (a) { this._url = "" } };
What does it do?
jsFiddle with full file. The same ULSqvN: ; occurs 47 times in the file.
edit: Added full code.
PS: The consensus seems to be that using a colon sharepoint is "not actual javascript, maybe used as a marker for some external purpose." The browser sees this as a rudimentary label and therefore does not cause errors. Thanks for all the answers, I left the actual use at the top so that the question contains the corresponding answers. question about the same code
source share