javascript mautic JS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript mautic JS相关的知识,希望对你有一定的参考价值。

//insert a script tag with the provided URL
MauticJS.insertScript('http://google.com/ga.js');

//wrapper around console.log
MauticJS.log('Something happened');

//transform an object properties into a key=value string
var obj = {firstname: "John", lastname: "Doe"};
var serialized = MauticJS.serialize(obj);  // Shows "firstname=John&lastname=Doe"

//document ready
function ready() {
  alert('test');
}
MauticJS.documentReady(ready);

/**
 *  Ajax
*/
//XMLHttpRequest: CORS Request
MauticJS.createCORSRequest('GET', 'https://mymautic.com/dwc/slot1');

//open a cross domain request to the specified URL
MauticJS.makeCORSRequest('GET', 'https://mymautic.com/dwc/slot1', [], function (response, xhr) {
    if (response.success) {
        document.getElementById('slot1').innerHTML = response.content;
    }
});

//take a text string and check to see if it is a valid JSON string
var text = '{"firstname": "John", "lastname": "Doe"}';

var json = MauticJS.parseTextToJSON(text);

alert(json); // Will show [object Object]

var text = 'not valid json';

var json = MauticJS.parseTextToJSON(text);

alert(json); // Will show 'not valid json'

以上是关于javascript mautic JS的主要内容,如果未能解决你的问题,请参考以下文章

Mautic - 亚马逊 API - Mautic 未记录退回/投诉

text mautic nginx

php mautic webhook

php mautic短信

php mautic chanel营销信息

php mautic动态内容