Whenever I click the search button, the sendTitle() function executes flawlessly. However, when I press the enter key (keyCode == 13), the sendTitle() function consistently throws a catch error response (alert cannot connect). I am curious if anyone understands why it fails to work when I hit enter on the form input field. You can find my code in a jsFiddle here. Thank you!
https://jsfiddle.net/k_g_j/yzcomd7s/4/
var sendTitle = function() {
// Function logic here
}
body {
font: 400 15px Lato, sans-serif;
/* More styles here */
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Head Content Here -->
</head>
<body>
<!-- Body Content Here -->
</body>
</html>