Page 1 of 1

Quick question regarding javascript alerts.

Posted: Thu Nov 06, 2014 4:01 pm
by Danny Sanderson

Hi

Currently I am using the Appery.io Mobile Tester to test my app.
When an alert pops up it has "page_name.html" which I don't think looks good.

My question is, does this only happen on the Mobile Tester or will this happen when the app is properly installed onto the device?

Thanks
Danny


Quick question regarding javascript alerts.

Posted: Thu Nov 06, 2014 4:52 pm
by Maryna Brodina

Hello!

It will be the same in installed app. Please check this post https://getsatisfaction.com/apperyio/...


Quick question regarding javascript alerts.

Posted: Thu Nov 13, 2014 2:49 pm
by Danny Sanderson

Hello,

I have just followed some of the steps on that link.

However, I don't understand this part.

In Your JavaScript asset add this to new or any file
function my_alert(my_title,my_text)
{
localStorage.setItem('my_title', my_title);
localStorage.setItem('my_text', my_text);
Appery.navigateTo('popup1', {});
}

Am I right in thinking I have to click on 'Create New' then 'JavaScript' and then add that code in there?

Image


Quick question regarding javascript alerts.

Posted: Thu Nov 13, 2014 3:05 pm
by Danny Sanderson

Nevermind, I have this working


Quick question regarding javascript alerts.

Posted: Thu Nov 13, 2014 3:10 pm
by Evgene Karachevtsev

Hello Danny,

Thank you for the update!


Quick question regarding javascript alerts.

Posted: Thu Nov 13, 2014 3:14 pm
by Danny Sanderson

Hello Evgene,

I have successfully created a pop up screen but I am unsure how to make it look like an actual pop up box. Like this one.

Image

I have changed the dimensions of the page, thinking that was the problem but it wasn't.

Any help would be appreciated

Thanks

Danny


Quick question regarding javascript alerts.

Posted: Thu Nov 13, 2014 9:47 pm
by Evgene Karachevtsev

Danny,

Please try using phonegap's alert
http://plugins.cordova.io/#/package/o...


Quick question regarding javascript alerts.

Posted: Fri Nov 14, 2014 9:47 am
by Danny Sanderson

Hi thanks for the reply.

I have added the following code to a JavaScript file on Appery.

function showAlert(txt) {
navigator.notification.alert(
txt, // message
alertDismissed, // callback
'Title', // title
'OK' // buttonName
);
}

I have then called this on a click event of a button.

showAlert("Testing my show alert");

Nothing happened when I clicked the button, I think I am doing something incorrect.

I get the following error.
Image


Quick question regarding javascript alerts.

Posted: Fri Nov 14, 2014 9:33 pm
by Evgene Karachevtsev

Danny,

This is a phonegap plugin, it works only as installed on the device application