Don't break the preview on websocket errors

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.

  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".

Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

Don't break the preview on websocket errors

Postby Acuario » Mon Jan 27, 2020 9:01 am

My html page has a websocket to connect to my server. Obviously in the preview this is not used but it throws an error dialog box which requires an action.
Can websocket errors be ignored as they are not relevant to the preview.

Code that causes the error:
Code: Select all
var host = location.hostname;
function WebSocketConnect()
{
    if ("WebSocket" in window)
    {
        // Open a web socket
        var ws = new WebSocket("ws://" + host + "/ws");
    }
}


I know I can avoid the error by checking if host is an empty string and not attempting the open if it is empty, but I feel it would be preferable not to see the error.
Acuario
 
Posts: 6
Joined: Wed Dec 18, 2019 9:14 am

Re: Don't break the preview on websocket errors

Postby chrisjlocke » Sat Aug 08, 2020 2:09 pm

During development, can't you just not use this code? Once you've got the HTML working, then add the socket code?
User avatar
chrisjlocke
Top Contributor
 
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Feature Requests

Who is online

Users browsing this forum: No registered users and 11 guests