<html>
<head>
<title></title>
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.common.min.css"
rel="stylesheet"
/>
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.rtl.min.css"
rel="stylesheet"
/>
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.default.min.css"
rel="stylesheet"
/>
<link href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.dataviz.min.css"
rel="stylesheet"
/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.3.1315/js/kendo.all.min.js"></script>
</head>
<body>
<div id="Stock">
</div>
<table>
<tr>
<td colspan="3">
<h2>
G.F. Corporation (GFC)
</h2>
</td>
</tr>
<tr>
<td>
<h2>
<span
id="spnAsk"></span>
</h2>
</td>
<td>
<div
id="divMark">
</div>
</td>
<td>
<h3>
<span
id="spnOpen"></span>( <span id="SpnMinus"></span>)</h3>
</td>
</tr>
</table>
<script type="text/javascript">
var apiStockUrl = 'http://testsites.cloudapp.net/api/Stock?symbol=vfc';
$(document).ready(function () {
var auto_div_refresh = setInterval(function () {
var FixdValue = "0";
$.getJSON(apiStockUrl)
.done(function (data) {
// alert(data);
$.each(data, function (key, item) {
//alert(item);
if (key == 'Ask') {
//var oAsk = item;
document.getElementById('spnAsk').innerHTML
= item;
}
if (key == 'Open') {
//var oOpen = item;
var Opnalue = document.getElementById('spnOpen').innerHTML = item;
var AskValue = document.getElementById('spnAsk').innerHTML;
Opnalue = 100;
AskValue = 70;
FixdValue = AskValue
- Opnalue;
document.getElementById('SpnMinus').innerHTML
= FixdValue.toFixed(2);
}
document.getElementById("divMark").innerHTML
= "";
if (FixdValue > 0) {
document.getElementById("divMark").innerHTML
= ">";
}
else if (FixdValue == 0) {
document.getElementById("divMark").innerHTML
= "=";
}
else {
document.getElementById("divMark").innerHTML
= "<";
}
});
});
}, 6000);
});
</script>
</body>
</html>
No comments:
Post a Comment