js里面jquery方法对应

取innerHTML

pd = document.getElementById("prj_data");
g_prj = pd.innerHTML;
//等效
g_prj = $('#prj_data').html();

ajax

$.ajax({                                //ajax操作
            url: "/menu_pages",    // 请求后端的url
            type: "post",           // 请求方式
            data: str_all,         // 向后端发送的请求体数据
            contentType: "application/json",    //指明后端发送的数据格式
            dataType: "json",       //指明后端返回的数据格式
            success: function (resp) {      // 发送成功之后的回调,resp是后端的返回值
                alert(resp.message);
                if (resp.code == 0){
                    ;//
                }
                else
                {
                    location.href = "/";
                }
            }
        })
发布了4 篇原创文章 · 获赞 0 · 访问量 65

猜你喜欢

转载自blog.csdn.net/ccmcu/article/details/105528258