Tuesday, 15 March 2011

Javascript,dont show undefined number -



Javascript,dont show undefined number -

ive createt varibale keys , values, looks like:

var e = new array(); e[0] = "bitte"; e[1] = "danke";

besides added line in variable wich showes text when number undefined.

e[nan] = "change settings";

so when variable e nan ("undefined"), want dont displays number of varible e in input. tried achive can see, wont function.

if (neuezahl = nan) { document.getelementbyid("saveserver").value=""; } else {document.getelementbyid("saveserver").value=""+neuezahl+""; }

thanks help, greetings germany! sorry englisch!

nan can't compared straight (it's not equal nan === nan ==> false). utilize isnan() observe nan:

if (isnan(neuezahl)) {...}

javascript

No comments:

Post a Comment