我在我的网站上使用了mautic时事通讯。
下面是我的js
代码。
/** This section is only needed once per page if manually copying **/
if (typeof MauticSDKLoaded == 'undefined') {
var MauticSDKLoaded = true;
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://resources.incarta.com.au/media/js/mautic-form.js';
script.onload = function() {
MauticSDK.onLoad();
};
head.appendChild(script);
var MauticDomain = 'https://resources.incarta.com.au';
var MauticLang = {
'submittingMessage': "Please wait..."
}
}
这是我的html
<div id="mauticform_wrapper_clicsnewsletter" class="mauticform_wrapper">
<form autocomplete="false" role="form" method="post" action="http://resources.incarta.com.au/form/submit?formId=2" id="mauticform_clicsnewsletter" data-mautic-form="clicsnewsletter">
<div class="mauticform-error" id="mauticform_clicsnewsletter_error"></div>
<div class="mauticform-message" id="mauticform_clicsnewsletter_message"></div>
<div class="mauticform-innerform">
<div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
<div id="mauticform_clicsnewsletter_email" class="mauticform-row mauticform-email mauticform-field-1">
<label id="mauticform_label_clicsnewsletter_email" for="mauticform_input_clicsnewsletter_email" class="mauticform-label">Email</label>
<input id="mauticform_input_clicsnewsletter_email" name="mauticform[email]" value="" class="mauticform-input" type="email" />
<span class="mauticform-errormsg" style="display: none;"></span>
</div>
<div id="mauticform_clicsnewsletter_submit" class="mauticform-row mauticform-button-wrapper mauticform-field-2">
<button type="submit" name="mauticform[submit]" id="mauticform_input_clicsnewsletter_submit" name="mauticform[submit]" value="" class="mauticform-button btn btn-default" value="1">Submit</button>
</div>
</div>
</div>
<input type="hidden" name="mauticform[formId]" id="mauticform_clicsnewsletter_id" value="2"/>
<input type="hidden" name="mauticform[return]" id="mauticform_clicsnewsletter_return" value=""/>
<input type="hidden" name="mauticform[formName]" id="mauticform_clicsnewsletter_name" value="clicsnewsletter"/>
</form>
</div>
当我尝试提交form
时,控制台上会显示以下错误:
app.js:190 Uncaught DOMException:阻止原始“https://resources.incarta.com.au”的框架访问跨源框架。
答案 0 :(得分:1)
好吧,运行代码片段似乎正确加载了iFrame,它只是需要一些工作的网页。在iFrame上,它表示页面可能已移至新地址。但是,当我访问Chrome页面时,它会说&#34;您的连接不是私密的&#34;。