How to check local server or internet server is online/offline using only js/jquery?

Hello Everyone

i am working to build an html template and add php contact form. i code to check whether my local server or (when i upload to internet hosting server ) internet server is online or offline to run my php file. if server is offline i want to show an error message page and i wants to find this using core javascript or jquery no angular nodejs or anyother framework. Thanks for reading and help me.

Hi @roman-khan,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.


Hi, thanks for reply i am new here.i just wants to get the answer of my question if you know kindly answer Thanks.

and i am in a discussion board according to me but as you told me how to switch to different board. 

Hi @roman-khan,

Sorry for any confusion. The GitHub Community Forum is meant to be a place for GitHub users to ask questions and share ideas with one another. There’s never a guarantee that a GitHub staff member or moderator will respond to your thread, nor that they will have the answer you’re looking for, especially if it’s not a topic specifically related to a GitHub product or service. 

I recommend waiting to see if another Community Forum user has an answer to your questions or can help. 

Thanks so much!