JavaScript in Contact Form 7

2019-09-15 15:53发布

I need a help with Contact Form 7 and additional settings.

I would like to add this script:

<script type="text/javascript" src="https://example.js?mid=0000&refer=example_name"></script>

to

on_sent_ok:

I tried to do it in many ways but it is not working.

1条回答
我想做一个坏孩纸
2楼-- · 2019-09-15 16:11

on_sent_ok expects a string of executable JS code.

So to load and execute an external script, you can use jQuery's getScript, like so:

on_sent_ok: '$.getScript("https://example.js?mid=0000&refer=example_name‌​")'
查看更多
登录 后发表回答