Created
February 21, 2010 07:39
-
-
Save vertis/310189 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<script type="text/javascript" src="jquery-1.3.2.js"></script> | |
<script type="text/javascript"> | |
function getItems(path) { | |
$.getJSON(path, | |
function(data){ | |
$.each(data.dataPackage.dataObject, function(i,item){ | |
$("#results").append("<a href=\"#\" onclick='link(\""+item.relationshipsUri+"\");'>"+item.properties.object_name+"</a><br/>") | |
}); | |
}); | |
} | |
function getRelationships(path) { | |
$.getJSON(path, | |
function(data){ | |
$.each(data.relationship, function(i,item){ | |
$("#results").append("<a href=\"#\" onclick='link(\""+item.target.relationshipsUri+"\");'>"+item.target.properties.object_name+"</a><br/>") | |
}); | |
}); | |
} | |
function link(url) { | |
//Needs to be a local path...this is a hack | |
//http://127.0.0.1:8080 | |
var path = url.substring(21, url.length); | |
alert(path); | |
$("#results").html(""); | |
getRelationships(path); | |
} | |
$(document).ready(function() { | |
getItems("/resources/core/repositories/test_repo/folders.json"); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="results"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment