title: "jQuery requires a window with a document" on jquery $get
body: <p>Why does this error happen when it try to use jquery? This code was working before but I don't even know what did I do for this error to happen. I tried to search about it and nothing I looked up makes sense or it's about this jsdom or whatever that I don't use. Exception is thrown on the 1st line in the try catch. That's the only error I could get from the browser debugger:</p>
  
  <pre><code>function DisplayName() {
      if (Page_ClientValidate()) {
  
          try {
              $get("lblNameShow").html = $get("&lt;%= txtNome.ClientID %&gt;").value;
              $get("lblDataAdmissaoShow").innerHTML = document.getElementById("datepicker").value;
  
  
              var ddlD = document.getElementById("&lt;%= ddlDepartamento.ClientID%&gt;");
              var strDDLDepart = ddlD.options[ddlD.selectedIndex].text;
              $get("lblDepartamentoShow").innerHTML = strDDLDepart;
  
              var ddlF = document.getElementById("&lt;%= ddlFuncao.ClientID%&gt;");
              var strDDLFunc = ddlF.options[ddlF.selectedIndex].text;
              $get("lblFuncaoShow").innerHTML = strDDLFunc;
  
              //get valor radio button
              var rstTel = $('#&lt;%=rblTelemovel.ClientID %&gt; input[type=radio]:checked').val();
  
              if (rstTel == 0)
                  $get("lblTelemovelShow").innerHTML = "Não"
              else
                  $get("lblTelemovelShow").innerHTML = "Sim"
  
              var message = "";
              var checkBoxList = document.getElementById("&lt;%=cblAppAlternativas.ClientID%&gt;");
              var checkBoxes = checkBoxList.getElementsByTagName("INPUT");
              for (var i = 0; i &lt; checkBoxes.length; i++) {
                  if (checkBoxes[i].checked) {
                      var value = checkBoxes[i].value;
                      var text = checkBoxes[i].parentNode.getElementsByTagName("LABEL")[0].innerHTML;
                      message += value + "-" + text + ",";
                  }
              }
  
              //alert(message);
              $get("lblAcessoShow").innerHTML = message;
              $get("lblObShow").innerHTML = $get("&lt;%= txtObservacoes.ClientID %&gt;").value;
  
          } catch (err) {
              $get("demo").innerHTML = err.message;
          }
  
          $('#NewColabModal').modal('show')
      }
      return false;
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>The code works if I remove the get from the jquery selector, but the strange thing is the code was working before. I can't find any info about using <code>$get</code> in jquery to select elements so I'm not sure about it if it's a plugin. This code was already implemented in the project I'm working on so I have no idea which plugin uses <code>$get</code>.</p>
  
  <p>on the original project these are the only references on it</p>
  
  <pre><code> &lt;link rel="stylesheet" type="text/css" href="jquery-ui-1.12.1.custom/jquery-ui.css" /&gt;
  &lt;script src="jquery-ui-1.12.1.custom/external/jquery/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="jquery-ui-1.12.1.custom/jquery-ui.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="NOTY/js/noty/packaged/jquery.noty.packaged.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>So I was using a try catch to catch the error but I was doing it in the wrong way since I'm still new to javascript. The exception I got is that <code>$get</code> is not defined. So rather than asking where <code>$get</code> comes from, how do I define a variable in jquery like <code>$get</code>?</p>