Jquery - CS:GO投注站点错误

Hello everyone

I am running into an issue where when I click on withdraw and verify my re-captcha afterwards it gives me this error:

Javascript error: SyntaxError: Unexpected end of JSON input at Object.parse (native) at Object.success (http://blur/template/js/offers.js?v=106:249:17) at j (http://blur/template/js/jquery-1.11.1.min.js:1:27244) at Object.fireWith [as resolveWith] (http://blur/template/js/jquery-1.11.1.min.js:1:28057) at x (http://blur/template/js/jquery-1.11.1.min.js:1:85993) at XMLHttpRequest.b (http://blur/template/js/jquery-1.11.1.min.js:1:90047)

So I had been looking and this is my code:

$.ajax({
        "url":url,
        dataType: 'json',
        success:function(data){
            try{
                console.log("Testing purposes: " + data);
                console.log("URL:" + url + g);
                //data = JSON.parse(data);
                if(data.success){
                    console.log(data);
                    $("#left .reals").empty();
                    $("#right .reals").empty();
                    $("#right .bricks").removeClass("hidden");
                    $("#avail").html(formatNum(data.balance));
                    var count = data.items.length;
                    var eleA = [];
                    for(var i=0;i<count;i++){
                        var item = data.items[i];
                        var url = IMG.format(item.img,110,50);
                        
                        


                        

                        

                        var price_class = "ball-1";
                        if(DEPOSIT){
                            price_class = "ball-0";
                        }

                        var slot_class = "";
                        var price_content = item.price;                     
                        
                        if(price_content==0){
                            price_content = item.reject;
                            slot_class = "reject";
                        }else{
                            price_content = formatNum(price_content);
                        }                       
                            
                        bot = 0;
                        if(item.botid){
                            bot = item.botid;
                        }
                        var botLabel = "";
                        if(!DEPOSIT){
                            botLabel = "Bot "+bot;
                        }

                        var ele = DIV.format(
                                item.name,i,item.price,bot,
                                item.name,i,item.price,bot,item.assetid,url,
                                item.name,
                                price_class,price_content,
                                slot_class,botLabel,item.view);
                        eleA.push(ele);
                    }
                    $("#left_number").html(count);
                    document.getElementById("left").getElementsByClassName("reals")[0].innerHTML = eleA.join('');

                    addPadding("#left",6);
                    
                    if(data.fromcache){
                        inlineAlert("success","Loaded "+count+" available items from cache - <a href=\"javascript:loadLeft('nocache')\">force reload</a>");
                    }else{
                        inlineAlert("success","Loaded "+count+" available items.");
                    }                               
                }else{
                    inlineAlert("error",data.error);
                    if(data.count>0){
                        cmd();
                    }
                }
                if(data.tid){
                    showPending(data);
                }
            }catch(err){
                inlineAlert("error","Javascript error: "+err.stack);
                console.log(err);
                console.log(url);
            }
        },
        error:function(err){
            inlineAlert("error","AJAX error: "+err.statusText + "<br />" + err.stack);
        },
    });
}

EDIT: I made it so that it doesnt have to parse to JSON. Added "dataType: 'json'," before the success:function.. But instead of a whole bunch of errors, it gives me AJAX Error: OK. So I added err.stack and it says "undefined".. EDIT2: Updated the code that I'm currently having now, only error it gives is AJAX Error now which says : OK (undefined)..

</div>

You should add a protection before calling data = JSON.parse(data), look if its an empty string.

Because trying this :

JSON.parse("")

gives me this error :

Uncaught SyntaxError: Unexpected end of JSON input(…)