【问题标题】:convert a colorbox popup into a normal popup将颜色框弹出窗口转换为普通弹出窗口
【发布时间】:2015-01-01 12:16:06
【问题描述】:

我目前正在开发基于 asp.net 和 vb.net 的 Web 应用程序。

这个应用程序以前是由另一个用户开发的,并且使用了各种类型的脚本,例如 Knockout Javascript、Ajax、Json、JQuery 等。

我现在想在普通弹出窗口中转换一些颜色框弹出窗口。但由于我不太擅长 ajax 和 KO-JS,所以我无法转换它。

以下代码在有人单击“继续”时将弹出页面 (send-communication.aspx) 作为颜色框弹出窗口打开,并且工作正常。但我只想将其作为普通弹出窗口打开。

链接按钮的代码是

<%@ Page Title="" Language="VB" MasterPageFile="~/_resx/E4.master" AutoEventWireup="false" CodeFile="new.aspx.vb" Inherits="E4_Jobs_Details_Interview_New" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
<input type="hidden" name="vid" id="vid" value="<%= Vacancy.ID.ToString()%>" />


     <a href="#" id="saveInt" class="btn">Continue</a>

</asp:Content>

页面的脚本是

<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ScriptContent">


    <script type="text/javascript" charset="utf-8">

     $(function () {

            var vid = $('#vid').val(), intId = $('#intId').val(), singleBooking = $('#singleInterview').val();


            $('.int-stage').change(function () {   updateCandidates(); });

            $('#saveInt').click(function () {  saveInterview();   });

            var saveInterview = function () {
                var applicants = [];
                $('.int-candidates option:selected').each(function (i, k) {
                   applicants.push($(k).val());
                });

            if (validateInterview(applicants, vm.interviewers(), vm.interviewTimes())) {

                $.ajax({
                    type: "POST",
                    url: '/_services/UtilityService.asmx/NewInterview',
                    data: "{'id':" + intId + ",'stage': " + $('.int-stage > option:selected').val() + ",'singleBooking':" + singleBooking + ",'reSchedule':'false', 'apps':[" + applicants.join() + "],'location':'" + $('.int-location').val() + "', 'description':'" + $('.int-description').val().replace("'", "&apos;") + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    cache: true,
                    success: function (r) {

                         if((parseInt(r.d))>0) {

                             var commUrl = "/e4/communication/send-communication.aspx?templatetypeid=1&communicationtemplateid=" + $('#intTemplate').val() + "&applicationid=" + applicants.join() + "&interviewid=" + r.d;
                             $.colorbox({ width: '900px', height: '90%', iframe: true, href: commUrl, open: true, overlayClose: false });
                        }
                    }
                });
                return false;
            }

        };

    });

    </script>

我是新程序员,当遇到 jquery 和 KO-JS 时,我真的很笨。

谁能建议我如何将页面(send-sommunication.aspx)打开为普通弹出窗口而不是颜色框弹出窗口

谢谢

【问题讨论】:

  • 你能解释一下“正常”弹出窗口是什么意思吗?您想在新窗口或标签页上打开页面吗?
  • 在新窗口中作为弹出窗口。不在标签上。

标签: jquery asp.net ajax knockout.js colorbox


【解决方案1】:

而不是调用 $.colorbox({ width: '900px', height: '90%', iframe: true, href: commUrl, open: true, overlayClose: false });

只要打电话 window.open(commUrl,"","width=900, height=900");

这将在新的浏览器窗口中打开网址

【讨论】:

    猜你喜欢
    • 2014-07-28
    • 2013-07-04
    • 2011-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-03
    • 1970-01-01
    相关资源
    最近更新 更多