# Show loading splash screen until hs chat is visible

**URL:** <https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474>\
**Category:** CMS Development\
**Tags:** professional\
**Created:** [June 7, 2021, 9:10am UTC](https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474 "2021-06-07T09:10:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakobtiebel](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jakobtiebel/32/44503_2.png) [@jakobtiebel](https://community.hubspot.com/u/jakobtiebel)\
**Post date:** [June 7, 2021, 9:10am UTC](https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474/1 "2021-06-07T09:10:48Z")

</div>

Hi folks,

I want to embed hs-chat on a single page for support reason. So far so good: [docbox - docbox](https://docbox.ch/chat.html)

But due to documented performance issues the chat window needs up to 5 sec until its visible (loaded).

Is it possible to show a loading splash screen until the chat window is visible?

I tried to use

`$(window).load(function() {});`

as indicator for the loading but it does not detect the chat.

Please advise.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [June 7, 2021, 2:22pm UTC](https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474/2 "2021-06-07T14:22:10Z")

</div>

@Kevin-C , any advice?

---

<div class="post-metadata">

**Author:** ![jonchim](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonchim/32/88818_2.png) [@jonchim](https://community.hubspot.com/u/jonchim)\
**Post date:** [June 8, 2021, 12:37pm UTC](https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474/3 "2021-06-08T12:37:08Z")

</div>

Hey @jakobtiebel,

Can you give this a shot and see if that works? you may just need to set a longer delay on your splash screen

`$(window).on('load', function()`

---

<div class="post-metadata">

**Author:** ![Kevin-C](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kevin-c/32/34570_2.png) [@Kevin-C](https://community.hubspot.com/u/Kevin-C)\
**Post date:** [June 11, 2021, 10:26pm UTC](https://community.hubspot.com/t/show-loading-splash-screen-until-hs-chat-is-visible/38474/4 "2021-06-11T22:26:02Z")

</div>

Thanks @dennisedson

This is a fun one!

Hey @jakobtiebel

You can check against **window.hubspot\_live\_messages\_running** using a recursive function:

```lia-code-sample
function doStuff() {
 if(!window.hubspot_live_messages_running) {// Check if it's true
 console.log('not yet');
 setTimeout(doStuff, 50);//Wait 50 millisecnds then recheck
 return;
 }
 console.log("It's ready!");//Do stuff
}
doStuff();

```

I think there might event be an event you can listen for but I haven’t had time to dig through[the docs](https://developers.hubspot.com/docs/api/conversation/chat-widget-sdk)
