declare
var WhWidgetSendButton;
ngOnInit() {
var options = {
facebook: "xxxx", // Facebook page ID
whatsapp: "xxx", // WhatsApp number
call_to_action: "Message us", // Call to action
button_color: "#008000", // Color of button
position: "left", // Position may be 'right' or 'left'
order: "whatsapp,facebook", // Order of buttons
};
var proto = document.location.protocol;
var host = "whatshelp.io";
var url = proto + "//static." + host;
let s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = url + '/widget-send-button/js/init.js';
s.onload = () => {
WhWidgetSendButton.init(host, proto, options);
};
let x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
答案 0 :(得分:0)
好像您在声明变量$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...'); //This raises an error
$this->db->trans_complete(); //A rollback is done, and should cancel the first query
,但从未设置它。
本质上是WhWidgetSendButton
,然后您试图在未定义的变量上调用WhWidgetSendButton = undefined
。
在致电.init(host, proto, options)
之前,您需要将init
设置为WhWidgetSendButton
之类。