我需要使用联系人7有一个嵌入表单,将信息提交给我的Viral Loops帐户。联系表格7:提交javascript的多行
它需要一次表单提交给运行下面的代码,即on_sent_ok:
VL.options.form_fields.form_firstName = $("#firstname").val(); //capture the first name
VL.options.form_fields.form_email = $("#email").val(); //capture the email
VL.options.form_fields.form_lastName = $("#lastname").val(); //capture the last name (if applicable in your form)
//submit the participant to Viral Loops
VL.createLead(function() {
//any logic to run after the participation
});
我不知道在哪里或如何添加它,因为您也可以利用一行代码只有在高级设置中发送确定。
在此先感谢! :)
它不是最易读的,但为什么不把所有的js放在一行呢?分号将关注区分任何一个语句的结束。 –
这或你可以把它作为一个函数在你已经入队的外部JS文件(https://developer.wordpress.org/reference/functions/wp_enqueue_script/)并从on_sent_ok调用函数 – Jonathan