强制iframe提交在父窗口中打开

时间:2017-05-23 20:10:36

标签: javascript iframe submit parent

我正在尝试在我的wix网站上嵌入一个表单。这个想法是,当有人提交表格时,感谢你"将显示页面而不是原始父页面。现在,编写代码的方式,"谢谢你"页面在提交时显示,但在iframe中显示,向上/向下滚动到两侧。我想强迫"谢谢你"要从iframe中显示的页面。 我是编码的新手,所以如果你能告诉我应该输入什么代码以及代码应该去哪里,我真的很感激。我已经包含了表单的原始代码。

提前致谢, ANAT

<!-- AT Popup Beta 2017 BEGIN -->
<link href="//cdn-media.web-view.net/popups/style/v1/main_combined.css" rel="stylesheet" type="text/css" />
<div id="_atPopupSU" class="shown"><div class="bl-template row-fluid bl-content-removable popup-dir-ltr" id="template-body" data-page-width="383" data-new-from-template="false">     <!-- BEGIN TEMPLATE OUTER -->     <div class="bl-template-main-wrapper span12" id="bl_0" valign="top">        <!-- BEGIN TEMPLATE MARGIN (Outside Margin - Padding) -->        <div class="bl-template-margin span12" id="bl_1" valign="top">            <!-- BEGIN TEMPLATE WRAPPER (Background) -->            <div class="template-main-table bl-template-background span12" id="bl_2" valign="top">                <!-- BEGIN TEMPLATE CONTAINER (Border, Inner Padding) -->                <div class="bl-template-border span12" id="bl_3" valign="top">                    <!-- BEGIN ZONES CONTAINER -->                    <!--zone-marked-->                    <div class="bl-zone bl-zone-dropable bl-zone-body row-fluid" id="bl_4" style="margin-top: 0px !important; background-color: transparent;" name="BodyZone" valign="top" height="">                   <div class="bl-block bl-block-signuptextpage" id="bl_5" blocktype="signuptextpage" name="signuptextpage" style="width: 383px;"><div class="bl-block-content" contenteditable="false"> <div> <div class="bl-block-content-table bl-block-dir-ltr span12"> <div class="bl-block-content-row bl-block-content-first-row bl-block-content-last-row span12" style="border-radius: 10px;"> <div class="bl-block-content-row-inner span12" style="padding: 50px 20px 18px;"><div class="bl-block-content-column bl-block-content-new-column span12"><div class="bl-padding-columns bl-content-wrapper span12"> <div class="bl-signup-container pull-left span12" at-form-width="12" style="border: 0px solid #191919; border-radius: 5px; padding: 8px 10px; background-color: transparent;">  <div class="bl-block-content-item bl-block-content-item-signupfieldpage bl-content-item-unremovable fields-left" style="text-align: center; margin-bottom: 14px;" data-is-auto-fill="true"><input type="text" maxlength="50" class="signup-field span12 input-ltr first-input" readonly="readonly" data-field-type="email" data-field-source="Email" data-mandatory="true" placeholder="Email " data-field-validation-msg="This is not a valid email" style="font-size: 12px; margin-bottom: 14px; height: 30px; line-height: 12px; font-family: arial, helvetica, sans-serif; text-align: left;" data-custom-values="" data-input-type="text"><input type="text" maxlength="50" class="signup-field span12 input-ltr" readonly="readonly" data-field-type="text" data-field-source="Ext1" data-mandatory="false" placeholder="Full Name" data-field-validation-msg="This is not a valid full name" style="font-size: 12px; margin-bottom: 14px; height: 30px; line-height: 12px; font-family: arial, helvetica, sans-serif; text-align: left;" data-custom-values="" data-input-type="text"><div class="confirm-emails" data-field-validation-msg="Please approve in order to receive our emails" style="font-family: arial, helvetica, sans-serif;"> <div class="checkbox ltr"> <label style="cursor: auto;"> <input type="checkbox" disabled="disabled" style="text-align: left;"><label class="confirm-label dir-label" style="font-family: arial, helvetica, sans-serif; text-align: left; cursor: auto; font-size: 11px; color: #000000;">I approve receiving emails</label></label></div> </div></div> <div class="bl-padding-columns bl-content-wrapper-columns" style="text-align: center;"> <div class="bl-block-button-content-wrapper" style="display: block; border-radius: 5px; background-color: #4ea3a3;"> <div class="bl-block-button-content-item-wrapper" style="font-size: 16px; padding: 9px;"> <div class="bl-block-content-item bl-block-content-item-button bl-content-item-unremovable" style="min-width: 1px; min-height: 16px; display: block; text-align: center; text-decoration: none;"><span style="font-size:14px;"><strong><span style="color:#FFFFFF;"><span style="font-family:arial,helvetica,sans-serif;">Sign Up Now</span></span></strong></span></div> </div> </div> </div> </div> </div></div></div> </div> </div> </div> </div></div>                     </div>                    <!-- END ZONES CONTAINER -->                </div>                <!-- END TEMPLATE CONTAINER -->            </div>            <!-- END TEMPLATE WRAPPER -->        </div>        <!-- END TEMPLATE MARGIN -->    </div>    <!-- END TEMPLATE OUTER --></div></div>

<script type='text/javascript'>
    (function () {
        var _atpopq = window._atpopq || (window._atpopq = []);
        window._atpopobj = {};
        if (!_atpopq.loaded) {
            var atpopjs = document.createElement('script');
            atpopjs.type = 'text/javascript';
            atpopjs.async = true;
            atpopjs.src = '//cdn-media.web-view.net/popups/lib/v1/loader.min.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(atpopjs, s);
            _atpopq.loaded = true;
        }
        _atpopq.push(['UserId', 'zzae3adduwau']);
        _atpopq.push(['PopupId', 'z3zdad']);
        _atpopq.push(['IsraelCode', '104']);
        _atpopq.push(['CountryCode', '226']);
        _atpopq.push(['IsEmbed', true]);
        _atpopq.push(['IgnoreMainCss', true]);
        _atpopq.push(['OnEventCallback', 'handleATPopupEvent']);
    })();
</script>
<script type="text/javascript">
    //Sample event handler function
    function handleATPopupEvent(ev,args){
        switch(ev){
            case 'display':
                //Do this when the popup is displayed
                break;
            case 'close':
                //Do this when the popup gets closed by the user
                break;
            case 'submit':
                //Do this when popup gets submitted and the user doesn't get redirected to a URL
                break;
        }
    }
</script>
<!-- AT Popup Beta END -->

1 个答案:

答案 0 :(得分:0)

我理解这部分代码,你应该放置代码行:

var listA = new List<A> { new A { Name = "John" }, new A { Name = "Peter" }, new A { Name = "Julia" } }; 
List<B> listB = listA.Select(x=> new B(x)).ToList(); 

如果提交&#39;。