Sundus,
It looks like you are just wanting to display data from the feature class table. Adding a where clause will work for this purpose. Here is an example based on a sample from the ESRI JavaScript API page. I have modified it to use your service.
ESRI Sample: Query data without a map | ArcGIS API for JavaScript
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Query Musanda Project Details</title>
<script src="http://js.arcgis.com/3.13/"></script>
<script>
require([
"dojo/dom", "dojo/on",
"esri/tasks/query", "esri/tasks/QueryTask", "dojo/domReady!"
], function(dom, on, Query, QueryTask) {
on(dom.byId("execute"), "click", execute);
function execute() {
queryTask = new QueryTask("URL to your Map Service");
//build query filter
query = new Query();
query.where = "ESRI_OID > 0";
query.returnGeometry = false;
query.outFields = ["*"];
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
queryTask.execute(query, showResults);
}
function showResults(results) {
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features.attributes;
for (var attr in featureAttributes) {
resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>");
}
resultItems.push("<br>");
}
dom.byId("info").innerHTML = resultItems.join("");
}
});
</script>
</head>
<body>
Projects:
<input id="execute" type="button" value="Get Details">
<br />
<br />
<div id="info" style="padding:5px; margin:5px; background-color:#eee;">
</div>
</body>
</html>
I hope this helps!
Regards,
Tom