$ is a shortcut for the word jQuery. Make sure you have the jquery library 
loaded in the header, or just replace $ with the word jQuery


On Tuesday, December 3, 2019 at 10:04:09 AM UTC-5, Jared wrote:
>
> Hi,
>
> I made a little JavaScript function (wind.js) that will update the Seasons 
> *current_widget* table with wind values from CRT realtime.txt.  The 
> function works perfectly fine if I drop it into the browser console after 
> the page loads, but for the life of me I cannot get this thing loaded by 
> itself.  The console always shows the error *$ is not defined* in 
> wind.js.  The errant line is *tbl = $('.widget_contents', 
> $('current_widget'));* where I am grabbing the table object.
>
> The index.html.tmpl <body> sections runs the setup(); function "onload" 
> from the seasons.js file, which looks like it establishes the widgets.  If 
> I drop <script src="wind.js"></script> after </body>, why are the widget 
> objects still undefined?  I've tried various methods of deferring this 
> script from being run, but nothing is working.
>
> This is literally the first thing I've ever created in JavaScript and am a 
> complete newbie in working with web programming, so go easy on me :)
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d2e8436b-a1d2-45a6-b253-bee40767cdec%40googlegroups.com.

Reply via email to