Right now I'm trying to get multiple callbacks from a single feed, however I keep getting "val parameter is undefined"
Here is the code:
var m,i=100,s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b=["#","@","http","www","tweet","twit","Twit","TWIT","tweep","blog","text","follower","Follower","Text","Twee","txt",".ly","follow",".com",".COM",".net","yahoo",".org"," DM"," RT","RT:"];
var count = 0;
var rand;
u=function() {
if (i--<1) {
location.reload();
return false;
}
document.getElementById('w').innerHTML = "<h2><font color =\"red\">Error :(</font></h2>" ;
while (typeof(w[i]) === "undefined" || typeof(w[i]) === "" || typeof(w[i]) === " " || typeof(w[i]) === null){
rand = Math.floor((Math.random()*100)+1);
if (typeof(w[rand]) === "undefined"){
rand = Math.floor((Math.random()*100)+1);
document.getElementById('w').innerHTML = w[rand].text ;
break;
}
else {
document.getElementById('w').innerHTML = w[rand].text ;
break;
}
count++;
if (count == 3){
document.getElementById('w').innerHTML = 'Error 404' ;
u();
break;
}
}
document.getElementById('w').innerHTML = w[i].text ;
document.getElementById('qr').innerHTML = qr[i].val; //<<THis is where the error occurs
};
r=function(data,data2) {
w=data['results'];
qr=data2['since_id'];//The error also occurs here accordingly
};
Any help is very appreciated!