Page 1 of 1

Panel javascript

Posted: Mon Apr 08, 2013 3:01 pm
by Andy Parker

If I have some javascript functions in my HTML code in a panel, how can I call those functions from within my code at will ?


Panel javascript

Posted: Mon Apr 08, 2013 3:16 pm
by Kateryna Grynko

Hi Andy,

You can use "Edit HTML"button to add JavaScript functions, but I would recommend you to describe them in JavaScript asset. Using Events panel, you can add "Run Javascripr" action to any event and call your JavaScript functions.


Panel javascript

Posted: Mon Apr 08, 2013 3:18 pm
by Andy Parker

ah, I see.

So I can call my library of javascript functions from the panel, I didn't realise that, thanks.

regards

Andy.


Panel javascript

Posted: Mon Apr 08, 2013 3:33 pm
by Andy Parker

Hi Katya,

I may be missing something;

I have an event listening that responds to a close button on the page.

I need to exit the app when this is clicked, so I added a call to
"closemyapp()" which simply calls "navigator.app.exitApp()" but this does'nt work.

Am I not doing this correctly?

code:

_inmobi.addEventListener("close", function(event)
{
closemyapp();
};


Panel javascript

Posted: Mon Apr 08, 2013 5:14 pm
by Kateryna Grynko

Andy,

On Events panel, on button click event add the action "Run JavaScript" with the following JS code:

codeclosemyapp();/code