Skip to content

Instantly share code, notes, and snippets.

@AleksandrZhukov
Created April 9, 2015 11:43
Show Gist options
  • Save AleksandrZhukov/7505382adfa3529c7103 to your computer and use it in GitHub Desktop.
Save AleksandrZhukov/7505382adfa3529c7103 to your computer and use it in GitHub Desktop.
json
<html><head>
<script type="text/javascript">
function loadXMLDoc()
{ var xmlhttp;
var txt, x, i;
if (window.XMLHttpRequest)
{ // код для IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{ // код для IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var obj = JSON.parse(xmlhttp.responseText);
document.getElementById("myDiv").innerHTML = obj.faculty.short_name;
}
}
xmlhttp.open("GET","http://cist.kture.kharkov.ua/ias/app/tt/P_API_DEPARTMENTS_JSON?p_id_faculty=95",true);
xmlhttp.send();
}
</script>
</head><body>
<div id="myDiv"></div>
<input type="button" onclick="loadXMLDoc()">Получить данные</input>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment