Danny Sanderson
Posts: 0
Joined: Thu Oct 09, 2014 1:59 pm

Quick question regarding javascript alerts.

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

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

Quick question regarding javascript alerts.

Hello!

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

Danny Sanderson
Posts: 0
Joined: Thu Oct 09, 2014 1:59 pm

Quick question regarding javascript alerts.

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

Danny Sanderson
Posts: 0
Joined: Thu Oct 09, 2014 1:59 pm

Quick question regarding javascript alerts.

Nevermind, I have this working

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Quick question regarding javascript alerts.

Hello Danny,

Thank you for the update!

Danny Sanderson
Posts: 0
Joined: Thu Oct 09, 2014 1:59 pm

Quick question regarding javascript alerts.

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

Danny Sanderson
Posts: 0
Joined: Thu Oct 09, 2014 1:59 pm

Quick question regarding javascript alerts.

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Quick question regarding javascript alerts.

Danny,

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

Return to “Issues”