zoukankan      html  css  js  c++  java
  • 分享一个双击后编辑并AJAX提交保存的脚本

        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery(".wordsupdate").dblclick(function () {
                    id = jQuery(this).attr('id');
                    text = jQuery(this).text();
                    if (text) {
                        jQuery(this).html("<textarea style='200px;height:50px;' name=" + id + " >" + text + "</textarea>");
                        jQuery(".wordsupdate > textarea").focus().blur(function () {
                            jQuery.ajax({
                                type: "POST",
                                url: "/Home/Update",
                                data: "ID=" + id + "&Str=" + jQuery("#" + id + " > textarea").val(),
                                success: function (msg) {
                                    jQuery("#" + id).html(jQuery("#" + id + " > textarea").val());
                                },
                                error: function (msg) {jQuery("#" + id).text(msg);}
                            });
                        })
                    }
                })
            })  
        </script>
  • 相关阅读:
    nginx 编译参数详解(运维不得不看)
    nginx安装(1) – ttlsa教程系列之nginx
    Nginx配置文件详细说明
    ubuntu下nginx的启停等常用命令
    Ubuntu 14.04 安装最新稳定版Nginx 1.6.0
    nginx启动、重启、关闭
    Ubuntu下基于Nginx实现Tomcat集群负载均衡
    在Ubuntu 14.04安装Nginx
    ubuntu完全卸载nginx
    ubuntu 下mysql中文乱码问题解决方案
  • 原文地址:https://www.cnblogs.com/bober/p/2345076.html
Copyright © 2011-2022 走看看