Problem with loading order.

Lynn
70 Posts
Lynn posted this 24 August 2021
Ask a Question

I have a button which links to a script for a chat room that is being displayed within a modal popup. The problem I'm having is that the script brings up a query box for the user to choose a name to log into the chat room; and it is doing this even before the page loads, long before clicking on the button! Since the button is in the header, it is doing this on every page. How can I get it to trigger only when the button for the chat room is pressed? The script is within it's own directory, so I can't understand why it is loading before the page has loaded.

I have a button which links to a script for a chat room that is being displayed within a modal popup. The problem I'm having is that the script brings up a query box for the user to choose a name to log into the chat room; and it is doing this even before the page loads, long before clicking on the button! Since the button is in the header, it is doing this on every page. How can I get it to trigger only when the button for the chat room is pressed? The script is within it's own directory, so I can't understand why it is loading before the page has loaded.

Last edited 24 August 2021 by Lynn

Vote to pay developers attention to this features or issue.
7 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 24 August 2021

Hi Lynn,

Please provide a link to the page where we can see the issue. Also provide some screenshots explaining how it should work.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi Lynn, Please provide a link to the page where we can see the issue. Also provide some screenshots explaining how it should work. ................................................... Sincerely, Hella Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
Lynn
70 Posts
Lynn posted this 24 August 2021

Hi Hella.
The site is at https://smefusionradio.com.
Notice that the request comes up even before the page loads. It should only appear once you click on the button "Join Live Chat"

Hi Hella. The site is at https://smefusionradio.com. Notice that the request comes up even before the page loads. It should only appear once you click on the button "Join Live Chat"
Support Team
Support Team posted this 25 August 2021

Hello Lynn,

Please specify how does this script work on not Nicepage pages?
We are not aware of how the script should work or not, please refer to the script developer to know how to set it correctly.

Thank you.
...................................................
Sincerely,
Anna T
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Lynn, Please specify how does this script work on not Nicepage pages? We are not aware of how the script should work or not, please refer to the script developer to know how to set it correctly. Thank you. ................................................... Sincerely, Anna T Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
Lynn
70 Posts
Lynn posted this 25 August 2021

It is setup in it's own folder. That is all I know. It is a very basic Chatroom script. I've attached it for you to look at. It's old and I don't think the developer is around any more.
The only reason that I can think of for this to happen is if Nicepage is preloading and executing all the html within the modal popups that all the buttons point to, in advance of the page loading.

It is setup in it's own folder. That is all I know. It is a very basic Chatroom script. I've attached it for you to look at. It's old and I don't think the developer is around any more. The only reason that I can think of for this to happen is if Nicepage is preloading and executing all the html within the modal popups that all the buttons point to, in advance of the page loading.
Support Team
Support Team posted this 26 August 2021

Hello Lynn,

Such behaviour is actually written within the code of this chat, index.php file, it is supposed to ask each user to write the name:

 // ask user for name with popup prompt    
    var name = prompt("Enter your chat name:", "Guest");

    // default name is 'Guest'
    if (!name || name === ' ') {
       name = "Guest";  
    }

    // strip tags
    name = name.replace(/(<([^>]+)>)/ig,"");

    // display name on page
    $("#name-area").html("You are: <span>" + name + "</span>");

    // kick off chat
    var chat =  new Chat();
    $(function() {

         chat.getState(); 

You would need to manually change the code or find another solution.

We support adding additional code HTML to the Site settings if you need to add to the head or HTML as an Element if you need to add the code into the body.
Scripts that are added to the HTML pages by setup as you did is the user's side responsibility.

Thanks.

...................................................
Sincerely,
Anna T
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Lynn, Such behaviour is actually written within the code of this chat, index.php file, it is supposed to ask each user to write the name: // ask user for name with popup prompt var name = prompt("Enter your chat name:", "Guest"); // default name is 'Guest' if (!name || name === ' ') { name = "Guest"; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); You would need to manually change the code or find another solution. We support adding additional code HTML to the Site settings if you need to add to the *head* or HTML as an Element if you need to add the code into the *body*. Scripts that are added to the HTML pages by setup as you did is the user's side responsibility. Thanks. ................................................... Sincerely, Anna T Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
Lynn
70 Posts
Lynn posted this 29 August 2021

Thank you for checking this out for me, Anna. Please can you tell me where I would need to add the code so that it only executes when the button is pressed?

Thank you for checking this out for me, Anna. Please can you tell me where I would need to add the code so that it only executes when the button is pressed?
Support Team
Support Team posted this 30 August 2021

Hello Lynn,

I hope there is no misunderstanding, but this script should be reworked not the way you have added it, as for now there is a part ask the user to enter the name.
...................................................
Sincerely,
Anna T
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Lynn, I hope there is no misunderstanding, but this script should be reworked not the way you have added it, as for now there is a part ask the user to enter the name. ................................................... Sincerely, Anna T Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
You must log in or register to leave comments