5

I came across the function below in one of the SharePoint system javascript files.

function RTE_InsertImage(strBaseElementID)
{ULS1Lu:;
   //A bunch of javascript
}

I have never seen something like ULS1Lu:; in any of the javascript code I have worked with before. Does anyone know what this is doing?

Sorry the weak title on the question. I wasn't sure how else to phrase it.

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486
  • possible duplicate of [Is using label's in JavaScript bad practice?](http://stackoverflow.com/questions/4906762/is-using-labels-in-javascript-bad-practice) – Jürgen Thelen Aug 29 '12 at 19:20

2 Answers2

10

Its a code label, technically they don't need the semicolon, but in javascript it shouldn't hurt. The label will allow a break or continue statement to jump the code back to it.

Most people consider that instead of labels it is better to use function calls whenever possible.

ajax333221
  • 11,436
  • 16
  • 61
  • 95
Robert
  • 2,441
  • 21
  • 12
3

Seems like they are just creating a Label. Possibly, as a marker or for some infamous use. Of course such labels owe a large part of their fame to goto statements.

Community
  • 1
  • 1
WeaklyTyped
  • 1,331
  • 4
  • 16
  • 31