Check if server is online?

T-T
I can’t figure this out. I’m trying to check if a server is online, and I need to do it efficiently. I have no idea where to start, i’ve tried AJAX, but it doesn’t really check if the server is online (it only checks if the URL is malformed)

I know somebody knows how to do this!!

So… anyone wanna help me fill this out? :3


function serverOnline(var server){

return false;
}

<3
thanks