Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

TypeError: $ .subscribe is not a function

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
tedybear57
Posts: 4
Joined: Sat 25 Apr 2020 7:30 pm
Weather Station: arduino
Operating System: windows 10

TypeError: $ .subscribe is not a function

Post by tedybear57 »

Hello, I have a little problem with the gauges I am installing them on my site to put the weather station data there but it does not work I have an error that goes back and I look for my I have not found can you help me ? I put the fault on you

Uncaught TypeError: $ .subscribe is not a function
     at init (gauges.js: 684)
     at Object.getInstance (gauges.js: 698)
     at init (gauges.js: 461)
     at HTMLDocument. <anonymous> (gauges.js: 4210)
     at j (jquery-3.2.1.min.js: 2)
     at k (jquery-3.2.1.min.js: 2)

Thank you
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: TypeError: $ .subscribe is not a function

Post by water01 »

Could we have a link to your web site please as that may help us diagnose the problem.
David
Image
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: TypeError: $ .subscribe is not a function

Post by sfws »

(text removed as not relevant)
Last edited by sfws on Sun 26 Apr 2020 1:31 pm, edited 1 time in total.
User avatar
HansR
Posts: 5870
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: TypeError: $ .subscribe is not a function

Post by HansR »

Just a guess: do you include jQuery.js twice or more?
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
tedybear57
Posts: 4
Joined: Sat 25 Apr 2020 7:30 pm
Weather Station: arduino
Operating System: windows 10

Re: TypeError: $ .subscribe is not a function

Post by tedybear57 »

Thank you for your answers

Unfortunately the site and not online I am developing it locally on my computer using symfony 5.

I use Jquery 3.2.1 as in the demo site which and data in the zip.

And for the last question yes I use it on the basic page for Bootstrap that poses problem?
User avatar
mcrossley
Posts: 12689
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: TypeError: $ .subscribe is not a function

Post by mcrossley »

Yes, including jQuery a second time will recreate the $ object. The gauge code extends the jQuery $ object by adding the publish/subscribe functionality.
User avatar
HansR
Posts: 5870
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: TypeError: $ .subscribe is not a function

Post by HansR »

tedybear57 wrote: Sun 26 Apr 2020 10:16 am And for the last question yes I use it on the basic page for Bootstrap that poses problem?
What @mcrossley says. Yes including jQuery more than once poses problems as I experienced recently.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
tedybear57
Posts: 4
Joined: Sat 25 Apr 2020 7:30 pm
Weather Station: arduino
Operating System: windows 10

Re: TypeError: $ .subscribe is not a function

Post by tedybear57 »

Ok i will test and i will come back to you to tell you anyway already thank you
tedybear57
Posts: 4
Joined: Sat 25 Apr 2020 7:30 pm
Weather Station: arduino
Operating System: windows 10

Re: TypeError: $ .subscribe is not a function

Post by tedybear57 »

It was good thanks for the help
Post Reply