Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myDatapoll(){
- $.ajax({
- type : "GET",
- url : '../myData.xhtml',
- dataType : "json",
- async : true,
- cache : false,
- success: function(data) {
- if(data!=null){
- if($("span[id='accBal-"+data.pID+"']").length>0){
- $("span[id='accBal-"+data.pID+"']").text(parseFloat(data.accBal).toFixed(2));
- }else{
- $("#cash").html('<span id="accBal-'+data.pID+'">'+parseFloat(data.accBal).toFixed(2)+'</span>');
- }
- }
- setTimeout('myDatapoll()',1000);
- },
- error : function() {
- }
- });
- }
- setInterval('myDatapoll()',1000);
- function myDatapoll(){
- //same as before but remove the setTimeout
- }
Add Comment
Please, Sign In to add comment