is there a way to convert this into javascript?
<?php
$url = 'http://www.yourdomain.com/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
Pure JavaScript? No.
JavaScript with a standard browser environment? Maybe. There is the XHR object (which includes the
statusproperty, which will tell you if it was successful or not), but there is also the same origin policy.