function httpGet(theUrl, webpass) { var xmlHttp = new XMLHttpRequest() xmlHttp.open( "GET", theUrl, false ) // false for synchronous request xmlHttp.setRequestHeader('token', webpass) xmlHttp.send( null ) if (xmlHttp.status == 200){ return xmlHttp.responseText } else{ return ""; } }