Streaming live at 10am (PST)

JQuery Typeahead not working

I’m hoping this is just a newbie mistake, but I’m trying to use a typeahead component on my site.
I’ve stripped things right back and the page link is below.

Once it loads, there is a dumb alert showing me that jquery itself has loaded just fine.

I’ve copied the exact

block containing all the webflow additions (copied from the resultant html), exact javascript (in the custom-code section) into codepen and it works fine, so I’m hoping there’s a setting in webflow I need to tweak.

The error I’m seeing in the console is Uncaught TypeError: $(…).typeahead is not a function

Any help would be most appreciated.
Cheers, Simon.

Hi @sigmazen, welcome to the forum :smiley:

The code might need a specific version of the jquery, which codepen loads and webflow doesn’t.
Try adding it to the code.

Hi … thanks for the response.
They’re both in synch. I’d overridden the codepen versions (and cdn source) to be identical to the versions I’d added in the webflow custom-code head-code section.
Thanks in advance for any other suggestions.

Can you share the codepen?

You did not add any version of jQuery script to you webflow project.

Here is the codepen

The JQuery is in the head-code in the custom code section

Try to add this to the page

I think that’s where I originally had it :wink:
Anyway, re-added … so it’s now at project-level and at page-level … still the same issue.
The browser-console is showing that it’s loading the state-list correct, but that the it’s breaking at this point $(".mytypeahead").typeahead({

try adding this custom attribute to the input:

Screen Shot 2020-03-19 at 16.40.18

No joy

Case sensitive !


I tried that first and then modified so it was the same as the jquery parameter :wink:

Thanks again


I have copied everything from codepen and it works fine :slight_smile:

:flushed: :heart_eyes: AWESOME

how’d you get all that extra stuff in there?
can you share the project?

1 Like

Thank you so much … I’ll go through and debug my effort to figure out where the mistake is.

1 Like

Stay safe out there :smiley:

Same to you …
btw I simply moved the entire JQuery from Project-level to Page-level, like you had, and it worked … I’m sure I had it there to start with :thinking:
I even removed the data-type to see if that was I originally missed and it still worked.
Either way … thanks again for you real-time help.
Back to playing with webflow now :slight_smile:

1 Like