1

I have the following code. The URL is to a MVC Webapi endpoint. When I load the page the URL doesn't get called. Can anyone help please?

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="css/typeahead.css" />
    <script type="text/javascript" src="scripts/jquery-2.1.1.js"></script>
    <script type="text/javascript" src="scripts/typeahead.bundle.js">    </script>
    <script type="text/javascript" src="scripts/bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/require.js"></script>
    <script type="text/javascript" src="scripts/bloodhound.js"></script>
    <script src="//twitter.github.com/hogan.js/builds/3.0.1/hogan-3.0.1.js">  </script>
</head>
<body>
    <input type="text" id="searchText" class="form-control typeahead" data-provide="typeahead" placeholder="Search" value=""
       autocomplete="off">
</body>
</html>
<script>
    $(document).ready(function() {

        $('#searchText').typeahead(null,       
            {
                name: 'address',
                remote: {
                    url: '/SearchWebAPI/api/searchitem'
                }
            }
        );
    });
</script>
Andrew Terwiel
  • 721
  • 4
  • 10

1 Answers1

0

I now have the data being retrieved from the Webapi. I'm now using Twitter Typeahead, not Twitter Bootstrap. This was confusing me. Also, I didn't understand how to use the Bloodhound library. Thanks to this answer for showing me how: Typeahead and Bloodhound - how to get JSON result

Community
  • 1
  • 1
Andrew Terwiel
  • 721
  • 4
  • 10