zoukankan      html  css  js  c++  java
  • layerUi与AJAX的一种思路

    javascript:
    function
    rep(id) { layer.confirm("确定要拒绝此认证吗?", { btn: ["确定", "取消"] }, function () { var url = document.getElementById("repulse-url").value; $.ajax({ type: "POST", url: url, data: { ids: id }, dataType: "json", success: function (data) { if (data == 0) { layer.msg("操作成功!", { icon: 1 }); setTimeout("location.reload()", 1000); } else { layer.msg("操作失败!", { icon: 2 }); } }, error: function () { layer.msg("系统错误!", { icon: 2 }); } }); }); }
            [HttpGet]
            public ActionResult Index()
            {
                ViewBag.DeleteUrl = "地址";
                return View();
            }
    <td>
      <div class="operate">
        <a href="javascript:;" class="gray" onclick="pas(@item.Id)" >通过认证</a>
        <a href="javascript:;" class="red" onclick="rep(@item.Id)">拒绝认证</a>
      </div> 
    </td> <input type="hidden" id="repulse-url" value="@ViewBag.RepulseUrl" /> <input type="hidden" id="pass-url" value="@ViewBag.PassUrl" />
  • 相关阅读:
    CheckBox循环删除代码
    最小二乘法原理
    break_VS_continue
    check the sentence &ff
    check_return
    check_FunctionAddress
    while执行两次的问题,已经解决
    CalculationWithDifferenceTpye
    SaveAboutZero
    check_negation
  • 原文地址:https://www.cnblogs.com/SeNaiTes/p/8890882.html
Copyright © 2011-2022 走看看