There is a problem with this method which I cant find out, here is example:
Example 1 (This example works fine)
--JS code---
var p = {
element1 : "" ,
Initial : function(){
this.element1 = document.getElementById("iddd");
},
MyFuction : function(){
this.element1.value="some text";
}
}
-----
-XUL code----
<label value="Put your XUL here!" id="iddd"
onclick="
*p.Initial();
*
*p.MyFuction();*
"
/>
-----
Example 2:
--JS code---
var p = {
element1 : "" ,
Initial : function(){
this.element1 = document.getElementById("iddd");
},
MyFuction : function(){
this.element1.value="some text";
}
}
*p.Initial();
window.addEventListener("load", p.MyFuction, true); *
-----
-XUL code----
<label value="Put your XUL here!" id="iddd"/>
-----
The second example DOES NOT work!
On Sat, Oct 25, 2008 at 8:23 PM, Roberto Bouzout (tito) <[EMAIL
PROTECTED]>wrote:
> You are welcome! :)
>
> joe ertaba wrote:
>
>> I find out that when I use initial function to initialize var then it
>> works!
>>
>> Thanks for your help
>>
>>
>> _______________________________________________
> Project_owners mailing list
> [email protected]
> https://www.mozdev.org/mailman/listinfo/project_owners
>
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners