jquery script not working

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets

jquery script not working

Postby lc4466 on Tue Jul 20, 2021 12:48 pm

Hi all! I'm trying to use the following jquery script to create expanding tables in my html5 output: http://jsfiddle.net/w6tL8abc/

This is the first time I'm trying to use scripting in Flare - the html/script shown in the fiddle is exactly what I have in my project for testing purposes (minus the broken images which I replaced with local files), and I just added the script through the insert > script inside of the body of the test page directly (I also tried moving to the header but same result). But when I build the file it doesn't seem to be running the script on load. Anyone know what I'm doing wrong?

EDIT: Well, I just tried moving the script to the bottom of the page and that seems to do it! Leaving this here in case it helps any other newbies trying out scripting - put it at the bottom, not the top!!
lc4466
Propeller Head
 
Posts: 18
Joined: Tue Jun 18, 2019 10:20 am

Re: jquery script not working

Postby Dave Lee on Wed Jul 21, 2021 1:31 am

I put all my jQuery inside a $( document ).ready() container, as that will wait until the page is ready to run scripts. I put the scripts somewhere inside the body (not head).
See: https://learn.jquery.com/using-jquery-core/document-ready/
Dave Lee
Master Propellus Maximus
 
Posts: 5996
Joined: Mon Mar 05, 2007 8:33 am
Location: UK


Return to Web-based Outputs

Who is online

Users browsing this forum: bgo and 6 guests