![]() ![]() Ctrl-X, then type Y to save the file and exit nano.That just gives jQuery an element with the “piTemp” ID to reference in the JS.Then, wherever you want to see the Pi’s temp text, add a tag like this:.Now we just need to call that getData() function each time the page is loaded so we do that in the body tag’s onLoad:.That JS uses jQuery’s ‘get’ function to read the text file and then jQuery’s text function to set that text into the element with the ID of “piTemp” (which is case- sensitive). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |