how to create static variable in java script
hi,
my app some balloons with a text inside.
i have to arrange them alphabetically.
to do, i have to create a static array such that when ever a balloon is clicked,a signal from qml to .js deletes first element of array
is it correct procedure?
error: signal deletes the element but for every click new array is generating
is there any other procedure to do?
its urgent. any one please answer
regards,
hema
Re: how to create static variable in java script
If it's that urgent, you should consider posting on a JavaScript forum. Qt has nothing to do with JavaScript.
For what it's worth, it sounds like you need a global variable, not a static one. But I loathe JavaScript, so I could be wrong.
Re: how to create static variable in java script
hi,
i gave a global variable in .js
but, separate variable is getting created for every component. i need only one for whole app.
Re: how to create static variable in java script
Like I said: go find a JavaScript forum. Your question has nothing to do with Qt.
Re: how to create static variable in java script
Quote:
Originally Posted by
hema
but, separate variable is getting created for every component.
So by definition the variable is not global. There are no static variables in javascript. Make the variable a property of the global object and it will be global.