Created
October 4, 2012 22:22
-
-
Save imjacobclark/3836852 to your computer and use it in GitHub Desktop.
Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function goCouch(form){ | |
var xmlHttp = false; | |
try { | |
var couchURL = form.databaseUrl.value; | |
var couchPort = form.portNo.value; | |
xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open( "GET", "http://" + couchURL + ":" + couchPort, false ); | |
xmlHttp.send( null ); | |
var couchWelcome = xmlHttp.responseText; | |
var requestedServerStatus = xmlHttp.status; | |
var status = document.getElementById("status") | |
status.innerHTML = couchWelcome; | |
event.preventDefault() | |
//alert(requestedServerStatus); | |
//alert(couchWelcome); | |
} catch (failed) { | |
var status = document.getElementById("status") | |
status.innerHTML = "Coulden't connect to the server there boyo."; | |
event.preventDefault() | |
} | |
var p = couchWelcome; | |
for (var key in p) { | |
if (p.hasOwnProperty(key)) { | |
alert(key + " -> " + p[key]); | |
} | |
break; | |
} | |
return false; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment