如何使用js直接打开窗体

来源:互联网 发布:南京行知基地冬季学农 编辑:程序博客网 时间:2024/05/16 17:21

//根据打印条形码


<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>

<input type="hidden" id="ctxpath" value="${ctx}" />


                function printBarCode(){
                var storageBarcode=$("#StorageBarcode").val();
                if(storageBarcode.length <= 0){
                $("#printmessage").html("Please input storage barcode and save it first.").css("color","red");
                return;                
                }
               
                $.ajax({
            url:"${pageContext.request.contextPath}/orderList/printStorageBarcode",
            type:"post",
            data:{"storageBarcode":storageBarcode},
            success:function(data){
            if(data!="error"){
            var url = $('#ctxpath').val() + "/barcode/" + data + ".pdf";
                       window.open(url);
            }else{
            $("#printmessage").html("Print storage barcode error.").css("color","red");
            }
           
            }
            });
                }
0 0
原创粉丝点击