views:

110

answers:

2

What is this doing exactly?

this.$blah = jQuery("<div id=blahblah1></div>");
+7  A: 

It's creating a new DOM element (div) wrapped in a jQuery object with the id blahblah1 and assigning it to a property of the current object. See the jQuery Core documentation for creating elements from HTML.

tvanfosson
and property name starting with a '$' is no different from any other property name, or does it bear some special meaning?
dalbaeb
It doesn't actually assign the div to the $blah property, but a jQuery object referencing that div
Mario Menger
@dalbaeb — No special meaning; '$' is just another name character in JS. Some folks, however (myself included) like to use it as a Hungarian prefix for jQuery objects.
Ben Blank
@Mario -- absolutely correct. I've updated.
tvanfosson
+1  A: 

This creates a new jQuery object which contains a newly created div with id blahblah1. The jQuery object is then assigned to the $blah property of the current object.

Mario Menger