I want to build an address book.

After I added the memSearch(), the page cannot loaded in Chrome, and it said: Uncaught ReferenceError: allData is not defined.

But when I delete memSearch(), everything is ok.

HTML Code:
<head>
<script>
function allData(){
	for (i = 0; i  < data.length; i++) {
		var stringInfo = data.getItem(data.key(i));
		var memInfo = stringInfo.split(',');
		$('#contacts').append('<div class="cards">'+'<div class="name">'+ memInfo[0] +'</div>' +'<div class="info">'+'<div class="phone">Phone:'+ memInfo[1]+'</div>'+'<div class="email">Email:'+ memInfo[2]+'</div>'+'</div>'+'</div>');
	};
};

function memSearch(){
	var memName = document.getElementById("mem-search-name").value;
	var dataLength = data.length;
	for (var i =0; i<dataLength, i++) {
		var stringInfo = data.getItem(data.key(i));
		var memInfo = stringInfo.split(',');
		if (memName == data.key(i)) {
			$('#found').append('<div class="cards">'+'<div class="name">'+ memInfo[0] +'</div>' +'<div class="info">'+'<div class="phone">Phone:'+ memInfo[1]+'</div>'+'<div class="email">Email:'+ memInfo[2]+'</div>'+'</div>'+'</div>');
			$('#found').slideToggle();
		};
	};
};
</script>
</head>
<body onload="allData()">
<div id="found"><div>
<div id="contacts"><div>
</body>