Streaming live at 10am (PST)

Help with JS code placement


#1

Need a little help with a potential project. I embeded this JS powered HTML contact form in Webflow via HTML embed component, and I tried sticking the JS on three places (site, page, and embed levels) it doesnt seem to be functioning correctly (I wrapped correctly I think)

  1. I’m assuming the JS script may be conflicting with webflow’s JS…but I don’t know enough to confirm or edit. (I’m assuming this is the case because the “Next” button isn’t functional)

  2. Here’s the Webflow link (please see the “test” page): https://preview.webflow.com/preview/rewirekb?preview=695c84fe11c309622d1af87b133a2749

  3. HTML Embed is on http://rewirekb.com/test (I’m using one of my older projects to demo this embed first before I start a new project. )

  4. JS script via Codepen: https://codepen.io/erizzl/pen/ypPmja

Is it possible to make this work in a Webflow embed component?

thanks for reading!


#2

You did not include jquery a second time. That’s good.

All custom JavaScript must be in the page or site footer, unless you know what you’re doing.

Your codepen also had an external resource (other than jquery) that you should include in the page footer, just before your code.


#3

Thanks so much for the reply! What do you mean by “page footer?” Is that the “Before body tag” section under page settings? or are we talking about a footer component on the actual page?

What is the correct way to include the 2nd source in the page footer?
I assume you’re talking about: //cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js

is there some syntax needed to reference that URL, or do I need to copy that whole script into the footer?


#4

I’m in the same situation than you.
I use a local js for forms, work fine but at the time you submit the form never send the email.
i think the webflow.js may conflicting with my js file because in other html page works perfectly.
:frowning:


#5

My code have a Local JS
(js/handledforms.js)
must be in the footer page too??
Thanks :slight_smile:


#6

Yes this is also called the page footer code field.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>

#7

2 posts were split to a new topic: How to use PHP code in Webflow


#8