如何修复Chrome代码控制台的此代码中的此错误?

时间:2017-02-22 04:38:13

标签: javascript google-chrome

我试图使用chrome的控制台,但是我收到了这个错误。

我几乎没有使用Chrome控制台的经验,所以请尝试彻底解释我的解决方案。

var hatIds = [362081769, 19027209] //This is the Ids of the hats
var PriceWanting = 1500 //This is the price


var Loop = setInterval(function(){
        for (var Id in hatIds) {
                var hatLink = "https://m.roblox.com/items/" + hatIds[Id] + "/privatesales"
                $.get(hatLink,function(data){
                        var Regex = /\<span class="currency-robux">([\d,]+)\<\/span\>/
                        var PriceSelling = data.match(Regex)[1]
                        PriceSelling = Number(PriceSelling.replace(",",""))
                        if (PriceSelling <= PriceWanting) {
                                var Regex2 = /<a href="\/Catalog\/VerifyTransfer\DuserAssetOptionId=([\d,]+)\Damp;expectedPrice=([\d,]+)">/
                                var HatBuyId = data.match(Regex2)[1]
                                var HatBuyLink = "http://m.roblox.com/Catalog/VerifyTransfer?userAssetOptionId=" + HatBuyId + "&expectedPrice=" + PriceSelling
                                var Explorer = document.createElement('iframe');
                                function Buy(){
                                        Explorer.contentDocument.forms[0].submit();
                                };
                                Explorer.onload = Buy;
                                Explorer.width = "300";
                                Explorer.height = "400";
                                Explorer.src = HatBuyLink;
                                document.body.innerHTML = "";
                                document.body.appendChild(Explorer);
                                clearInterval(Loop)
                        }
                });
        }
        console.log("!")
},0)

错误消息:

Uncaught TypeError: Cannot read property '1' of null
    at Object.success (<anonymous>:10:61)
    at o (jquery-1.7.2.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.7.2.min.js:2)
    at w (jquery-1.7.2.min.js:4)
    at XMLHttpRequest.d (jquery-1.7.2.min.js:4)

此错误消息是什么意思?

我在使用Chrome控制台方面不是很有经验,而且这是其他人的一部分&#39;来自Google的代码我试图使用。

这个程序应该做的是转到ID提供的链接,我提供了一个Roblox的标准化链接系统。该链接是项目链接。我试图通过反复检查价格是否足够低并购买该物品,以低价购买Roblox上的这些物品。

1 个答案:

答案 0 :(得分:0)

点击该错误,您将从哪一行得到错误......