Ram
Posts: 0
Joined: Fri Aug 02, 2013 12:15 pm

i give up... simple IF doesnt work, what am I missing here?!

Dear Appery,

this is driving me NUTS!!!!

i have this simple code:
code
var xfilter = Appery("list_menu").find("option:selected").text();

console.log("xfilter=" + xfilter);

alert(xfilter);

if (xfilter == "Show All") {
var xfilter='*';
alert(xfilter);
};
/code

this is the console printout:
code
xfilter=​Show All
/code

and yet i dont step into the if condition if true...

what am I missing here?!

Thanks much in advance!!!!
Best,
R.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

i give up... simple IF doesnt work, what am I missing here?!

Hi:) We'll take a look.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

i give up... simple IF doesnt work, what am I missing here?!

There seems to be extra spaces. Try using trim() procedure prevar xfilter = Appery("list_menu").find("option:selected").text().trim();/pre

Ram
Posts: 0
Joined: Fri Aug 02, 2013 12:15 pm

i give up... simple IF doesnt work, what am I missing here?!

Dear Maryna,

Thank you for your reply!

you were right, again :) the funny thing is that i thought it was some kind of white space so i tried:

< code
.replace(/\s/g, "")

but it didnt do what the Trim does...

as always, you're awesome!

Image

Return to “Issues”