• DWZ 在js中刷新某个navTab


      当时的想法是:

      上传一个文件成功后 刷新navTab ,关闭上传文件dialog.

    function fileNameBack(args){
      //表单毁掉函数 alertMsg.correct(args[
    "msg"],null); navTab.reloadFlag("main");//navTab的名称 $.pdialog.closeCurrent(); }
    <form action="" method="post" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="return iframeCallback(this, fileNameBack)">
    
    </form>

    args是后台返回的json字符串:

      后台方法

        JSONObject resultJson = new JSONObject();
        resultJson.put("msg","成功!");
        context.sendAsString(resultJson.toString());
    
    
    public void sendAsString(String s,String... encoding) {
            String charset = "UTF-8";
            if(encoding.length==1){
                charset = encoding[0];
            }
            response.setContentType("text/html; charset="+charset);
            response.setHeader("Cache-control", "no-cache");
            response.setCharacterEncoding(charset);
            try {
                response.getWriter().write(s);
            } catch (IOException e) {
                throw new RuntimeException("response write json error.info: " + e.getMessage());
            }
        }            
  • 相关阅读:
    WebApi整合Unity容器实现IOC编程
    用户登录
    Mvc验证码
    代理模式 实现aop
    装饰器模式,实现aop
    Redis
    图片缩放
    递归操作文件
    几种文件的读写方式
    C#WebApi自动生成文档
  • 原文地址:https://www.cnblogs.com/clovem/p/6960045.html
Copyright © 2020-2023  润新知