javascript - jscript if for global variable -


here's code

var isnew = true  function limb(a,b) {     if (isnew=true)      {         post(a,b);         isnew = false;         post ("first");     }     else     {         post(a,b);         post ("not first");      } } 

the problem i'm having else condition never triggered. i'm assuming value of isnew never updated, have no idea why.

in languages = used both assign values , compare them. javascript uses different operators each of these.

x = 10 means "set x 10, , give me value of x".
x == 10 means "tell me if x equal 10".

so condition have been if(isnew == true) , have worked. can put if(isnew).


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

ASP.NET Javascript: window.open won't work twice -

jquery - Opera does not change the height of the page. Why? -