1

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?

M. A. Kishawy
  • 5,001
  • 11
  • 47
  • 72
jpap
  • 11
  • 3

0 Answers0