Page 1 of 1

set property javascript API

Posted: Tue Apr 08, 2014 2:44 am
by Yan Yi

Hi! May I check what is the Appery javascript API for set property? I wish to set some properties from my local storage on pageshow.

Things I want to set: Image and labels
My code:
code
var pic = localStorage.getItem('photobuffer');

var name = localStorage.getItem('name');

Appery('photo_img').val(pic);

Appery('name_label').val(name);
/code

Also tried the following which did not work:
code Appery('photo_img').setProperty(pic);

Appery('name_label').setProperty(name);/code


set property javascript API

Posted: Tue Apr 08, 2014 3:07 am
by Igor

Hi Yan.

To set "src" attribute for the image you should use:
pre
Appery('photo_img').attr("src", pic);
/pre
To set label text you should use following code:
pre
Appery('name_label').text(name);
/pre