TypeError: pickupList is not an object

383
November 21, 2016, at 11:16 PM

I have a currently fairly dysfunctional Javascript program that's been causing me problems. However, it throws one error that I just don't understand:

TypeError: pickupList is not an object

        pickCount=objectLength(pickupList);
        pickkeys=Object.keys(pickupList);
        if (pickupList=="Fail") {
            PICKUP ="<th>PICKUP</th>";
            for (var i = 1; i <= l; i++) 
            {
                    PICKUP+= "<td id='"+((i<10) ? '0'+i : i)+'pkup'+rm_id+"'></td>";        
            }
        }
        else
        {
            var bo1;
            for (var u = 0; u < pickCount; u++) {
            $.ajax({
                url:'assets/ajax/viewAjax2event.php',
                type:'POST',
                data:{competitorID:pickkeys[u],monthi:monthi,yeari:yeari},
                success:function(result)
                { 
                    bo1=JSON.parse(result);
                },              
                async:false
            });
            PICKUP+="<tr><th value="+pickkeys[u]+">"+pickupList[pickkeys[u]]+"</th>";
            for (var i = 1; i <= l; i++) 
            {
                PICKUP+= "<td class='sort' cdate1='"+((i<10) ? '0'+i : i)+"' rmID="+rm_id+" name="+pickkeys[u]+" contenteditable='"+((sit<1)? 'false' : (((monthi==monthc) && (i<day))? 'false': 'true' ))+"' onblur='editPickUp($(this).attr(\"name\"),$(this).text(),$(this).attr(\"cdate1\"),"+rm_id+")' id='"+((i<10) ? '0'+i : i)+"pickup"+u+"'>"+((i<10)? ((typeof(bo1['0'+i])!=='undefined')? bo1['0'+i]: "0") : ((typeof(bo1[i])!=='undefined')? bo1[i]: "0"))+"</td>";     
            }
            PICKUP+="</tr>";
            }
        }

Any ideas would be great. Frankly, I just can't see why I'm getting a TypeError. plus, it's working with latest version of firefox and chrome.

READ ALSO
My ajax function isnt sending the data

My ajax function isnt sending the data

First of all Im working with google maps and im using tomcat[nnn]and what im trying to do is that when i click on the map, I place a marker and[nnn]at the same moment y send the lat and long of the point.

266
Froala Editor 2 basic init Uncaught TypeError: undefined is not a function

Froala Editor 2 basic init Uncaught TypeError: undefined is not a function

I just follow froala documentation and mix it with current layout using metronic. .

517
Using Browser Action Chrome Extension

Using Browser Action Chrome Extension

I am creating a Chrome Extension which 'cleans' the links from Google Search results and then enables the user to see all the links from the search result and let them copy any URL from the list. .

492