Jonathan Wood Jonathan Wood - 1 year ago 72
jQuery Question

Meaning of $get('0')?

I just upgraded to jQuery 1.12 from an older version. I'm going through the code, trying to resolve breaking changes.

One such change is occurring in the following code:

$(document).ready(function() {
function applciationUnloadHandler() {
var contactDropDown = $get('0');
createCookie('NewProgram_ContactID_Cookie', contactDropDown.value, null);

This code fails because

But I really don't understand what this is supposed to be doing. I don't see
defined anywhere. I can see from looking at the code behind that the
argument represents a contact ID, but I can't see what the code is supposed to be doing.

Answer Source

$get is a shortcut function for Sys.UI.DomElement.getElementById

The $get method provides a shortcut to the getElementById method of the Sys.UI.DomElement class.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download