在练习ajax中遇到

很有可能是jQuery版本过低导致的


更换版本即可
在低版本中运行如下代码是不行的
 1 function a2() {
 2             $.post({
 3                 url: "${pageContext.request.contextPath}/a2",
 4                 data: {"pwd":$("#password").val()},
 5                 success:function (data) {
 6                     if (data.toString()==="ok"){
 7                         $("#passInfo").css("color","green");
 8                     }else {
 9                         $("#passInfo").css("color","red");
10 
11                     }
12                     $("#passInfo").html(data);
13                 }
14             });
15         }

 

相关文章:

  • 2021-05-24
  • 2021-12-05
  • 2021-09-11
  • 2021-05-31
  • 2022-12-23
  • 2021-07-20
  • 2022-01-14
猜你喜欢
  • 2022-01-17
  • 2021-08-05
  • 2022-12-23
  • 2021-09-18
  • 2021-11-22
  • 2021-04-12
  • 2021-07-28
相关资源
相似解决方案