Hi,everyone
In JS I want to pass the array to the XML inside, what I need to do???
Worry,Worry,Worry
Thanks,Thanks
js pass array to xml
-
-
Hi
what kind of array?
array system in krpano looks like this or so
<myarray name="somename">
<item name="i0" value="value0_or_what_ever"/>
<item name="i1" value="value1_or_what_ever"/>
<item name="i2" value="value2_or_what_ever"/>
<item name="i3" value="value3_or_what_ever"/>
<item name="i4" value="value4_or_what_ever"/>
</myarray>access to array items and values
array[somename].item[2] (used index)
array[somename].item[i2] (used name)it's just example
or even so
<myarray name="i0" value="200"/>
<myarray name="i1" value="400"/>
<myarray name="i2" value="300"/>
<myarray name="i3" value="100"/>myarray[2].value == 300
and read docu here http://www.krpano.com/docu/actions/#arrays
Regards
Andrey -
And about pass from javascript to krpano
there is javascript krpano interface http://www.krpano.com/docu/js/#top
so you can use normal javascript for set/add variables http://www.krpano.com/docu/js/#interfaceobjectRegards
Andrey -
just wondering how to set dynamically new sub-Nodes to the existing array?
I take the array
<myarray name="somename"><item name="i0" value="value0_or_what_ever"/>
<item name="i1" value="value1_or_what_ever"/>
<item name="i2" value="value2_or_what_ever"/>
<item name="i3" value="value3_or_what_ever"/>
<item name="i4" value="value4_or_what_ever"/>
</myarray>
How to add a new subnode like:
<item name="i5" value="value5_or_what_ever"/>tried:
txtadd(myarray[somename].item[name], i5, 'value=value5_or_what_ever');No success...
Any Ideas?
Steve
-----------------------------------------------------------------------------------------------
EDIT:
OK, found the solution:
set(myarray[somename].item[i5].value, value5_or_what_ever) -
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!