Page 1 of 1

Adding suffix to local variable

Posted: Thu Mar 29, 2012 3:31 pm
by Shlomi

Hi,

I would like to use input from the user (mobilesearchbar1), add suffix to it (as hello), and saving it to local variable (locInputSuffix) using the following java script:

var s = Tiggr('mobilesearchbar1');
localStorage.setItem('locInputSuffix', 's.val()+hello');

But it doesn't work. Any idea why?

Thx,
Shlomi


Adding suffix to local variable

Posted: Thu Mar 29, 2012 3:45 pm
by maxkatz

Try:
code
localStorage.setItem('locInputSuffix', s.val()+'hello');
/code


Adding suffix to local variable

Posted: Thu Mar 29, 2012 4:11 pm
by Shlomi

Cool!