I would like to produce a stanza message with JSJaC:
<message to...'
from='..'
type='chat'>
<menu>
<submenu>...</submenu>
<submenu>...</submenu>
</menu>
</message>
The problem is that I don't know from the begining the number of submenus, so I have to use a loop. I have tried
var msg = new JSJacMessage();
msg.setTo(...);
msg.setType('chat');
msg.appendNode('menu',
for(i=0; i<Number; i++){
msg.appendNode('submenu': i);
});
I get errors. I also tried to make a string and turn it into object, instead of the loop, but with no success.
Any ideas?