themac
Posts: 0
Joined: Fri Mar 08, 2013 9:36 pm

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

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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

themac
Posts: 0
Joined: Fri Mar 08, 2013 9:36 pm

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

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

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

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

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/

Return to “Issues”