Automatically launch script

Develop and Deploy Cross-Browser Web Apps .

Automatically launch script

Postby joedarock » Mon Feb 01, 2016 7:44 pm

I want my script to start automatically, but only after xui is loaded and initialized because I want the script to use some of xui's resources. How can I tell my script to start?

Joe
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: Automatically launch script

Postby joedarock » Tue Feb 02, 2016 11:09 am

Anyone?
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: Automatically launch script

Postby support » Wed Feb 03, 2016 11:08 am

support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am

Re: Automatically launch script

Postby joedarock » Wed Feb 03, 2016 2:14 pm

Thanks for the reply.

Note that the example, as written is missing a semi-colon. I rewrote it as follows:

xui.main(function(){
alert('first');
});

and the alert now fires properly. Now, if I include a call to my main function as follows:

xui.main(function(){
getSiteData();
//alert('first');
});

I get the following error:

Uncaught node.js Error
ReferenceError: lbl_ComStatus is not defined
at showComStatus (file:///C:/Program%20Files%20(x86)/CrossUI/XUIWorkSpace/blank%20project/SC4_UtilityFunctions.js:37:45)
at getSiteData (file:///C:/Program%20Files%20(x86)/CrossUI/XUIWorkSpace/blank%20project/SiteData.js:11:9)
at Object.<anonymous> (file:///C:/Program%20Files%20(x86)/CrossUI/XUIWorkSpace/blank%20project/SC4_UtilityFunctions.js:32:5)
at Function._.merge.tryF (file:///C:/Program%20Files%20(x86)/CrossUI/runtime/xui/js/xui-debug.js:268:71)
at HTMLDocument.xui._domReadyFuns (file:///C:/Program%20Files%20(x86)/CrossUI/runtime/xui/js/xui-debug.js:1581:19)
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: Automatically launch script

Postby support » Wed Feb 03, 2016 3:06 pm

Did you used some widgets in the xui.Com?

If you want to load something for xui.Com, you need use onReady/onRender Event.
support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am

Re: Automatically launch script

Postby joedarock » Thu Feb 18, 2016 6:45 pm

I accomplished this in my app like this:

In the project start page, I have this line in with all the other UI code:

_com_onrender:function (com, threadid){
initializeApp();
,

This starts up my application, which is in another file.
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron