How to add a javascript to my webpage

I do not understand code and that is why I love Sparkle. Unfortunately I’ve encountered a problem which seems to require javascript and I don’t know how to add it. The page I’ve created links to specific page numbers within a 78 page pdf. It works fine on desktop computers but not on iOS. The problem and solution is described here Create a Web Link to a Specific PDF Page For Desktop & iOS

If Sparkle offers an easier solution, please tell me. Otherwise I need to learn how to add that javascript to my webpage. Searching this community suggested using the code widget.

I can not seem to find the widget or info about how to use it. Perhaps it is in a different version of Sparkle. I am using v5.5.3 on an M1 MacBook Pro. I appreciate any suggestions you may have. Thank you.

Hey @RickDe welcome onboard! :slight_smile:

I have never done this trick, but for sure you can place javascript on your Sparkle webpage.
If you go to the “+” at the top of our Sparkle UI (User Interface) and click on it you will towards the bottom of your open window under the heading “Special”, see Embed

When your click on the Embed a small placed container will show on your canvas which you can resize and drag anywhere. You will also see that on the right hand panel it opens a container labeled Embedded Content. This is where you place your javascript and “save” it.

If you are in a country (or deal with clients in certain countries) you might have to leave Activate After Consent ticked, which means the javascript will only work once your User has consented.

Hope this help! :slight_smile:

Thank you VERY MUCH for the quick response. As with everything in Sparkle, the solution was so easy I can’t believe I failed to see it. Unfortunately the javascript I was adding fails to solve the problem but that is not Sparkle’s fault. I suspect iOS has changed in the 2 years since the script was shared online. I will search for an updated solution and now I know how to add it to my page in a few quick clicks! I appreciate you taking time to teach me this feature.

1 Like

Thanks for telling it helped me as well… :smile:

1 Like