|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
|
|
|
|
<!--script type="text/javascript" src="jquery-1.10.2.js"></script-->
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
var myjson;
|
|
|
|
|
|
|
|
function query(workid){
|
|
|
|
console.log(workid);
|
|
|
|
var title = myjson[workid]['Title'];
|
|
|
|
var creator = myjson[workid]['Creator'];
|
|
|
|
var description = myjson[workid]['Description'];
|
|
|
|
console.log(title, creator, description);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function readJSON(){
|
|
|
|
$.getJSON( "allworks_mmdc.json", function(data){
|
|
|
|
myjson=data;
|
|
|
|
console.log(myjson);
|
|
|
|
console.log(Object.keys(myjson));
|
|
|
|
testJSON(myjson);
|
|
|
|
hover();
|
|
|
|
})
|
|
|
|
|
|
|
|
$('span').hover(
|
|
|
|
function(){
|
|
|
|
var thisid = $(this).attr('id')
|
|
|
|
query(thisid);
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body onload="javascript:readJSON();" >
|
|
|
|
<h3>Testing <span id="9961">JSON</span></h3>
|
|
|
|
<h3>Hover over the words <span id="9939">JSON</span> and look at the console</h3>
|
|
|
|
</body>
|
|
|
|
</html>
|