Custom Liquid to reference the spinner on a specific page

Hi I’m trying to check if the current page is loaded and if it is not then it should display the spinner.

this is the script Thank you

<script
src="{{'page.book-an-appointment' | page_url }}"
onload="this.loaded=false;window.trigger('snippet.loading-spinner:loaded');"
></script>

Hi @AssistantMJS , thank you for posting here!

I’d be glad to help you with the script to check if the page is loaded and display a spinner accordingly.

Here’s an improved version that addresses the issues raised and combines the best aspects of both responses:


If my answer is helpful, please let me know by accepting the Solution and giving a Like !!!

1 Like

Hi thank you for this @WizzCommerce_Co
I do need help on which liquid it’s best to add this function ? Thanks again