I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js:

function ULSrE8(){
  var o=new Object;
  o.ULSTeamName="Microsoft SharePoint Foundation";
  return o;
var SPGridView_CallbackContext=null;
function SPGridView_FilterPreMenuOpen(gridViewClientId, 
                                     dataFieldName, e)
    var gridView=document.getElementById(gridViewClientId);

What does {ULSrE8:; do?

  • 1
    Also, in SP.debug.js an object called ULS5V1 is cleared and instantiated in a similar way before every single function. Mystifying myself, too, as I can't find any definition of what :; does in JavaScript... – James Love Oct 13 '11 at 10:57
  • Indeed a mystery. – Anatoly Mironov Oct 13 '11 at 11:41

A similar question was asked on StackOverflow some time ago (just found it).

This answer provides the information you are searching.

To provide a short version of the answer: strictly talking, the line "ULSrE8:;" does nothing (it does not execute the function) BUT the label is used by some intricate diagnostic/error logging code that parses the function and searches token labels in that format.

You can read a more precise description in the the above link (I won't copy the full answer - please refer to the original post by Paul Lucas).

(Note: I don't know if there is a way or the need to mark this quesion as a partial duplicate as the original question is on another stackexchange site)

  • 1
    Want a realistic perception of SharePoint from other developers? Have a read at all the comments ;) – James Love Oct 13 '11 at 13:30
  • 3
    ... and why you think my user name is SPArchaeologist? I'm still searching for my personal version of the Rosetta stone to decode the ancient languages and criptography of MSDN documentation... – SPArchaeologist Oct 13 '11 at 13:33
  • I like it! Setting up a museum to SharePoint, running on Tahoe? :P – James Love Oct 13 '11 at 13:37
  • Thank you very much for the answer for the provided, @SPArchaeologist. due to ":;" it was hard to google it. I hade never seen this before I started developing for Sharepoint, so I thought it was only Sharepoint stuff. Now I know what it is it does feel good. – Anatoly Mironov Oct 13 '11 at 13:51
  • +1 Good find! I can't really close a dupe across SE sites easily.. so let's just leave it for now. :) – Kit Menke Oct 13 '11 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.