Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I had develop the blazor application. For internet connection status I had

found AddEventListner in search engine. This is example

JavaScript
window.addEventListener("online", function () {
    new bs5.Toast({
        body: 'Hurray!Internet is connected',
        header: `<h6 class="mb-0"> online </h6>`,
        placement: 'bottom-left',
    }).show();
}); window.addEventListener("offline", function () {
    new bs5.Toast({
        body: 'Opps! Internet is disconnected',
        header: `<h6 class="mb-0"> Offline </h6>`,
        placement: 'bottom-left',
    }).show();
});



but I want to internet connection status when api failed due to internet

disconnected because I don't want any proper process for checking connection

status


please help me

thanks.

What I have tried:

but I want to internet connection status when api failed due to internet

disconnected because I don't want any proper process for checking connection 

status
Posted
Updated 4-Feb-23 23:05pm
Comments
Ramesh p 5-Feb-23 5:02am    
i don't want navigator.online for checking internet connection
Graeme_Grant 5-Feb-23 5:04am    
It is how it is done in Javascript ... google it

Here is another JS way ... How to Check Internet Connection in HTML CSS & JavaScript[^] however, navigator.online is the final check after an endpoint fails ... you then know why...

1 solution

This is the same question you have asked several times before: asking again isn't going to change the answers you already have ... but it will annoy people.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900