Jump to content

pwstrength js error found


Recommended Posts

includes/jscript/pwstrength.js version 5.3.7

 

 

issue: bar was not showing on registration or view cart and in the showStrengthBar function on your document.write you are using .name. which is the wrong syntax.

 

found js error reported by FF console

 

SyntaxError: missing name after . operator pwstrength.js:60

 

 

 

original code

 

document.write('<table align="center"><tr><td>'.langPasswordStrength.':</td><td width="102"><div id="pwstrengthpos" style="position:relative;float:left;width:0px;background-color:#33CC00;border:1px solid #000;border-right:0px;"> </div><div id="pwstrengthneg" style="position:relative;float:right;width:100px;background-color:#efefef;border:1px solid #000;border-left:0px;"> </div></td><td><div id="pwstrength">'.langPasswordWeak.'</div></td></tr></table>');

 

corrected document.write with new code (tested and works)

 

changed to: +langPasswordStrength+ and +langPasswordWeak+

 

function showStrengthBar() {
   if(typeof langPasswordStrength === 'undefined'){
       var langPasswordStrength = "Password Strength";
   }
   if(typeof langPasswordWeak === 'undefined'){
       var langPasswordWeak = "Weak";
   }
   document.write('<table align="center"><tr><td>'+langPasswordStrength+':</td><td width="102"><div id="pwstrengthpos" style="position:relative;float:left;width:0px;background-color:#33CC00;border:1px solid #000;border-right:0px;"> </div><div id="pwstrengthneg" style="position:relative;float:right;width:100px;background-color:#efefef;border:1px solid #000;border-left:0px;"> </div></td><td><div id="pwstrength">'+langPasswordWeak+'</div></td></tr></table>'); 
}

 

thanks..

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated