Page 1 of 1

How to make my script executes only when i'm in corresponding page

Posted: Wed Mar 05, 2014 8:55 pm
by themac

How to make my script executes only when i'm in corresponding page ?
I inserted a "script" into a page named gallery (into an "html" component).
But the script inserted into it is exedcuted also when the app starts (with the startpage and not the gallery page).

This is because i've render all the app in one single page ?

Is there a way to prevent this ?

I shared the app (baciuzzi products).

Thanks in advance !

TheMac


How to make my script executes only when i'm in corresponding page

Posted: Wed Mar 05, 2014 9:21 pm
by Maryna Brodina

Hello! Why don't you invoke code on Load or Show page event?


How to make my script executes only when i'm in corresponding page

Posted: Thu Mar 06, 2014 11:33 am
by themac

HI Maryna,

i'm trying, but, following photoswipe tutorial, will i need the html object ?
or i can delete it ?

And, if i keep it, how can i write into it ? Using jquery $("html_1").write ? or .appendHtml ?

THanks

TheMac


How to make my script executes only when i'm in corresponding page

Posted: Thu Mar 06, 2014 1:47 pm
by Nikita

Hello,

Yes, you should add html component like this: http://docs.appery.io/tutorials/addin...

This is the right way of using append:
https://api.jquery.com/append/