JavaScript in Contact Form 7

不想你离开。 提交于 2019-12-25 09:01:23

问题


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:


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‌​")'


来源:https://stackoverflow.com/questions/39853108/javascript-in-contact-form-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!