将colorbox弹出窗口转换为普通弹出窗口

时间:2014-11-05 10:31:40

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

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

此应用程序以前由其他用户开发,使用各种类型的脚本,如Knockout Javascript,Ajax,Json,JQuery等。

有一些colorbox弹出窗口,我现在想要在普通弹出窗口中转换。但由于我不太擅长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)作为普通弹出窗口而不是彩盒弹出窗口

由于

1 个答案:

答案 0 :(得分:1)

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

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

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