I need to debug this function. It is saying CANNTO READ PROPERTIES OF NULL(reading zero)
Fantastic news! We've Found the answer you've been seeking!
Question:
I need to debug this function. It is saying CANNTO READ PROPERTIES OF NULL(reading zero)
function clicked() {
var search = document.getElementById("search");
var results = localStorage.getItem(search);
if(results = null)
{
document.getElementById("results").innerHTML = "There are no results for that route name."
}
else
{
var stops = results;
var output='';
for(var key in stops[0])
{
//5
var output = output + '' + key + ' : ' + stops[0][key] + '
';
}
document.getElementById("result").innerHTML = output;
}
};
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: