My Code is giving error
My Jquery code is below, but it is always giving 'Failed to load the
content', i need to make an ajax call to get the data using rest api. Any
help please.
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var cat_id = ${coreNode.ancestors[0].id};
var restUrl = "http://xyz./restapi/vc/categories/id/"+cat_id+"/boards";
$.ajax({
type: "POST",
url: 'restUrl',
contentType: "text/xml; charset=utf-8",
data: "DATA",
success: function (response) {
alert(restUrl);
$(response).find("board > title").each(function () {
href = $(this).text();
alert(href);
});
},
error: function (response) {
$('#float-threads').html('Failed to load the content');
}
});
});
</script>
<div id="float-threads">
</div>
No comments:
Post a Comment