Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

javascript - 从节点服务器检索值后在Pug(Jade)中发出警报(Alert in Pug(Jade) after retrieving a value from the node server)

I want to implement an alert when the page loads under an expecific circunstance ,retrieving the value from an Node server when the user or passwowrd are wrong.

(我想在特定情况下加载页面时实施警报,当用户或密码错误时从Node服务器检索值。)

But it just doesnt do anything.

(但是它什么也没做。)

I had tested it and yes, ErrorCon(the variable i get from my Node server) get its expected value when the circunstance appear so the node part shouldnt be the problem This is the code i am trying to apply, right in the body:

(我已经对其进行了测试,是的,ErrorCon(我从我的Node服务器获取的变量)在情况出现时获得了预期值,因此节点部分不应该成为问题。这是我尝试应用的代码,就在正文中:)

 script.
  (function (){
    function init(){
      var Errors=ErrorCon;
      if (Errors==1){
        alert("Wrong password");
      }
    }
  window.addEventListener?
  window.addEventListener('load',init,false):
  window.attachEvent('onload',init);
  })(); 

The same structure works on a different page yet here it just doesnt do anything.

(相同的结构可以在不同的页面上运行,但是在这里它什么都不做。)

Help

(救命)

  ask by Dekir translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...