0

Can someone explain how the following js syntax works?
Is this a function?
Why is the syntax like this?
How does it work (accessed)?

SomeName(function()
{
	otherFunction();
	
	var form = document.forms.passengerInformation;
	
    
    toggleCreateProfileFields();
	SomeName("#createUserProfileCheckbox").click(function() {
		toggleCreateProfileFields();
	});
});
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mairtinomarta
0

Looks a little like jquery or some other Javascript library is being used.
Libraries like jquery make javascript so much easier to use.

Instead of writing getElementById("createuserprofilecheckbox")
in jquery you'd write $("#createuserprofilecheckbox")

I'm guessing the above function may have been written for a different library, personally i'm only familiary with jquery.

0

Yes! I think you are correct! Thanks! I just found this bit of code, so I think my function is an extension of jQuery.

var SomeName=jQuery.noConflict();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.