【问题标题】:jquery is missing when using hubspot forms inside wordpress site在 wordpress 网站中使用 hubspot 表单时缺少 jquery
【发布时间】:2018-03-16 14:28:24
【问题描述】:

我想在我的 wordpress 网站中集成 hubspot 表单,一切正常我可以提交表单并查看来自 hubspot 的数据,但回调函数只有一个问题 onFormReady()由于 jQuery 不存在而没有被执行。

错误是: hbspt.forms.create 中的 onFormReady 函数需要 jQuery。它没有运行。

Eventhout 我已经从 function.php 中获取了 jquery,并且我实际上可以使用 jQuery,例如在 head 脚本部分工作。

这是 hubspot 代码:

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"></script>
<script>
hbspt.forms.create({
    portalId: "x",
    formId: "xxxx",
    onFormReady: function() {
        alert("hello");
    }
});
</script>

知道如何在 onFormReady() 中执行一些代码吗?

另外,如果这是不可能的,我们能否以某种方式使用 jQuery 捕捉网站上发生的任何提交?我尝试了几种无法使用 jQuery 捕获表单提交的方法!

【问题讨论】:

    标签: javascript wordpress wordpress-theming hubspot hubspot-crm


    【解决方案1】:

    我必须添加这个脚本 &lt;script charset="utf-8" src="http://js.hubspot.com/forms/current.js"&gt;&lt;/script&gt; 让它工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-14
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多