$ is not defined解决方案

找半天原因,就一點直接上图

把你引入的js文件,放在jquery.min.js后面就可以了,页面的加载顺序不同所以位置放置不一样再顺带写上jquery+ajax的代码吧

$.ajax({
                type : 'POST',
                url : 'export.do',
                contentType: "application/json",
                dataType : 'json',//注意使用的是打他dataType,而不是Content-Type
                data : parms,
                success : function(data) {
                    if (data) {
                        alert("登录成功")
                        window.location.href = "hello.html";
                    } else {
                        alert("用户名密码错误!");
                    }
                }
            });

猜你喜欢

转载自www.cnblogs.com/DIVEY/p/10218724.html
今日推荐