<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: $ not defined / jQuery not supported? in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779200#M33685</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/501715"&gt;@SRalston05&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HubSpot stopped supporting the latest jQuery version from the build-in option inside the settings where you can enable it.&amp;nbsp;But when using the build in jQuery, you need to write it in full or wrap it like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wrapper function:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;jQuery(function($) {
  var selector = $('.element');
} &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var selector = jQuery('.element'); &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it's even better to use vanilla JS so don't have to rely on jQuery if it get's disabled.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var selector = document.querySelector('.element'); &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's also good to check the article&amp;nbsp;&lt;A href="https://developers.hubspot.com/cms/guides/jquery/upgrade" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;&lt;SPAN class="" data-hs-cos-general-type="widget" data-hs-cos-type="text"&gt;How to upgrade to the latest version of jQuery for extra information&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 08:05:11 GMT</pubDate>
    <dc:creator>Indra</dc:creator>
    <dc:date>2023-04-07T08:05:11Z</dc:date>
    <item>
      <title>$ not defined / jQuery not supported?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779126#M33684</link>
      <description>&lt;P&gt;I don't know much about Hubspot. I'm trying to modify a form for a customer. I need to use jQuery but when I try something as simple as a $document.ready() log to console I get "Uncaught ReferenceError: $ is not defined" in Chrome DevTools Console. I've tried the instructions shown here -&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/website-pages/include-jquery-across-your-hubspot-pages" target="_blank"&gt;https://knowledge.hubspot.com/website-pages/include-jquery-across-your-hubspot-pages&lt;/A&gt;&amp;nbsp;- but I'm not finding the same options described in that article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And is javascript/jQuery availability determined by the type of Hubspot account?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve R.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 22:46:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779126#M33684</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2023-04-06T22:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: $ not defined / jQuery not supported?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779200#M33685</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/501715"&gt;@SRalston05&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HubSpot stopped supporting the latest jQuery version from the build-in option inside the settings where you can enable it.&amp;nbsp;But when using the build in jQuery, you need to write it in full or wrap it like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wrapper function:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;jQuery(function($) {
  var selector = $('.element');
} &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var selector = jQuery('.element'); &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it's even better to use vanilla JS so don't have to rely on jQuery if it get's disabled.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var selector = document.querySelector('.element'); &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's also good to check the article&amp;nbsp;&lt;A href="https://developers.hubspot.com/cms/guides/jquery/upgrade" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;&lt;SPAN class="" data-hs-cos-general-type="widget" data-hs-cos-type="text"&gt;How to upgrade to the latest version of jQuery for extra information&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 08:05:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779200#M33685</guid>
      <dc:creator>Indra</dc:creator>
      <dc:date>2023-04-07T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: $ not defined / jQuery not supported?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779985#M33723</link>
      <description>&lt;P&gt;What are you trying to achieve? There may be a better way to achieve it than jQuery.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're trying to modify a Hubspot form&amp;nbsp;&lt;SPAN&gt;$document.ready() won't work anyway as you need to wait until after the form has loaded using a &lt;A href="https://legacydocs.hubspot.com/global-form-events" target="_blank" rel="noopener"&gt;Global Form Event Listener&lt;/A&gt; like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;window.addEventListener('message', event =&amp;gt; {
   if(event.data.type === 'hsFormCallback' &amp;amp;&amp;amp; event.data.eventName === 'onFormReady') {
      // YOUR CODE HERE
   }
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 16:52:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/779985#M33723</guid>
      <dc:creator>BarryGrennan</dc:creator>
      <dc:date>2023-04-10T16:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: $ not defined / jQuery not supported?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/780601#M33756</link>
      <description>&lt;P&gt;There definitely may be a better way to do what I'm trying to do. I need to add the values of one set of checkboxes, a couple text fields, and a select input into a hidden text area. When the form is submitted, that field, along with some others, gets sent to a remote API. The main act of submitting the form works fine, I just need to get the values I mentioned into the text area, because the text area has a place in the API but the other fields do not.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 22:02:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/not-defined-jQuery-not-supported/m-p/780601#M33756</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2023-04-11T22:02:51Z</dc:date>
    </item>
  </channel>
</rss>

