Page 1 of 1

Navigate to other page with JS

Posted: Thu Jan 29, 2015 6:19 am
by Fatih Mert Do?ancan

Hello,

I have two pages.
I want to redirect to both. I am using a button clicking event with javascript code.

My codes are true! I added the last of row. (button2)

Apperyio.navigateTo("page2",{});

If I looking mobile preiview, button2 clicking forever loading bar turns :)
So my page is happening timeout.

How to solve this?

Thank you for interest.


Navigate to other page with JS

Posted: Thu Jan 29, 2015 6:48 am
by Peter LPunkt

Look at errors in console -- if you dont have, install Chrome Dev Tools

try codeApperyio.navigateTo("page2");/code

if you want a transition: code Apperyio.navigateTo('page2', {
transition: 'slideup'
});/code


Navigate to other page with JS

Posted: Thu Jan 29, 2015 6:56 am
by Fatih Mert Do?ancan

I look. Thank you. I am using Firefox.

And, I choiced window storage, (because I can't use localStorage), error is;

"window is not defined"


Navigate to other page with JS

Posted: Thu Jan 29, 2015 6:59 am
by Fatih Mert Do?ancan

I need a global variable.


Navigate to other page with JS

Posted: Thu Jan 29, 2015 10:10 am
by Evgene Karachevtsev

Fatih,

Unfortunately this is a pure JS, and it is outside of the scope of our support. You should search for the solution online. For example here: http://stackoverflow.com/questions/57...


Navigate to other page with JS

Posted: Thu Jan 29, 2015 10:59 am
by Fatih Mert Do?ancan

Already, I am using "window" but It showed me up error. I don't solve it :S


Navigate to other page with JS

Posted: Thu Jan 29, 2015 11:52 am
by Evgene Karachevtsev

Fatih,

Could you please detail what error do you get?


Navigate to other page with JS

Posted: Thu Jan 29, 2015 6:08 pm
by Fatih Mert Do?ancan

Firefox console, "window is not defined".

We are defining in function. But We want defining to function out for global variable. Apperyio this disallow.

How I can do it?

My work is public. Editor can change.

Thank you again.

---------------- EDIT

I added new javascript file from "create new", I will guess this like it happening. (depo.js)

var __ygs = {};
var __lys = {};
var __net = {};

And, I added this storages from about of the page, this like;

__ygs['Blabla'] = var1;
__ygs['Blabla2'] = 321;

This time no error, They aren't keep to data.

Apperyio("test1").text(__ygs["Blabla"]);

Result is NaN.

---------------- LASTLY

I found it http://devcenter.appery.io/tutorials/...

and try, this result is same NaN


Navigate to other page with JS

Posted: Fri Jan 30, 2015 12:50 pm
by Fatih Mert Do?ancan

Firefox console, "window is not defined".

We are defining in function. But We want defining to function out for global variable. Apperyio this disallow.

ADD 1

I added new javascript file from "create new", I will guess this like it happening. (depo.js)

var __ygs = {};
var __lys = {};
var __net = {};

And, I added this storages from about of the page, this like;

__ygs['Blabla'] = var1;
__ygs['Blabla2'] = 321;

This time no error, They aren't keep to data.

And after try like apperyio type; (result is same still !)

localStorage.setItem('Blabla',var1);

Apperyio("test1").text(__ygs["Blabla"]);

Result is NaN.

ADD 2

I found it http://devcenter.appery.io/tutorials/...

and try, this result is same NaN.

ADD 3

I clear all this, I create a new LocaleStorage type of Number from Model and Storage. It is name is "ygs1" and My value sent page clicking button with "run javascript" event. Write this code (after my transactions );

localStorage.setItem('ygs1',YGS1);

And Page orientation with button clicking. I added Set Property from this page, I selected my localStorage variable. So "ygs1"

Second, Load event add "run javascript" code;

Apperyio('test1').text(localStorage.getItem('ygs1'));

Result is NaN.

I don't understand ! Almost I tried everthing since yesterday.

---------------------

My project is public, so editor can change ! (I have a one project)

Thank you for interest.
I am waiting for you feedback !


Navigate to other page with JS

Posted: Fri Jan 30, 2015 4:22 pm
by Alena Prykhodko

Replied here https://getsatisfaction.com/apperyio/...
Also, you can always check whether there are errors in console.