javascript 邮票表格提交和事件作为属性

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 邮票表格提交和事件作为属性相关的知识,希望对你有一定的参考价值。

//Find Form submission events and map them to Identify calls.
_.map(_.filter(events, { event: 'Demo Form Submitted' }), event => {
  //Build a payload with the properties we're interested in.
  const payload = _.pick(
    event.properties,
    'lang',
    'country',
    'company',
  );
  //Save them as a property in the Traits group
  hull.traits(payload);

  //Save them as a property in the `demo` group
  hull.traits(payload, { source: "demo" });
});


// ======= OR =======
// If you don't want to overwrite certain values and keep the first ones submitted.

_.map(_.filter(events, { event: 'Demo Form Submitted' }), event => {
  const { properties } = event;
  hull.traits({
    email: { operation: "setIfNull", value: properties.email },
    lang: { operation: "setIfNull", value: properties.lang }
    //...
  });
});

以上是关于javascript 邮票表格提交和事件作为属性的主要内容,如果未能解决你的问题,请参考以下文章

洛谷P2725 邮票 Stamps

有没有办法使用 javascript/Jquery 将未提交的输入字段的值属性作为 URL 的参数传递?

避免多次提交

触发动作表单提交JavaScript的HTML

使用javascript自动填写“表格”和“提交”而不按“提交”[重复]

Javascript 错误事件属性中的行和列