ajax 提交

来源:互联网 发布:58自动发帖软件 编辑:程序博客网 时间:2024/05/01 06:41
$(function () {   $("#btn_commitfile").click(function () {        ImportPeiSong();    });});function ImportPeiSong() {                var path = $("#File1").val();                $.ajax({                    type: "post",                    data: "method=importPeisong" + "&path=" + path,                    url: "../DataHandlers/Union/UnionPolicyState.ashx",                    success: function (status) {                        alert('dfdgg');                    }                });            }    

以上为单独js页面写法。


原页面写法:

<script type="text/javascript">        $(function () {            $("#btn_commitfile").click(function () {                ImportPeiSong();            })        });            function ImportPeiSong() {                var path = $("#File1").val();                $.ajax({                    type: "post",                    data: "method=importPeisong" + "&path=" + path,                    url: "../DataHandlers/Union/UnionPolicyState.ashx",                    success: function (status) {                        alert('dfdgg');                    }                });            }                  </script>

打开新窗口:
 function ImportDeliveryInfo() {             var content = "<iframe width='300px' height='180px' frameborder='0' src=\"ImportDeliveryInfo.aspx?id=" + id + "\" ></iframe>";             var t = new Boxy(content,                         { unloadOnHide: true, draggable: true, show: true, modal: true,                             title: "导入配送信息",                             closeText: "<img src='../_css/controls/boxy_img/fancy_close.png'>"                         });         }



原创粉丝点击