- 724 Posts
- 3 Reply Likes
Posted 4 years ago
- 724 Posts
- 3 Reply Likes
onOnline, onOffline and mybackButton callback should out from deviceready funtion?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
However, how did you define your function 'exitApp'?
Is that function executed? Do you get a javascript error as soon as that function is called? Does it fail somewhere within that function? And where do you call navigator.app.exitApp?
- 724 Posts
- 3 Reply Likes
I just used your code snippet .
Petra please tell me,, where i will defile it.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
It was 'semi-code', remember? Not real code. It was just a piece of 'explanation' to show you along what lines it is done.
Have you looked up how to exit from an app in Android (doesn't work in iOS, anyway)?
Look, you must try and find solutions for these small, simple things yourself! You must learn that.
What if your app is live, and after a while, the client wants some changes? He expects you to be knowledgeable enough to do it....and I might not be around to hold your hand and do it for you.
- 724 Posts
- 3 Reply Likes
If I did yet, then I will do ahead too :) Thank you.
You are true Teacher. Perhaps therefore from beginning u didn't told me complete source code. :) By d way. It's u, who taught me all, even it's jquery, or javascript or php :) thankful to u
- 724 Posts
- 3 Reply Likes
<script>$(document).ready(function() {
document.addEventListener("offline", onOffline, false);
document.addEventListener("online", onOnline, false);
document.addEventListener("backbutton", mybackButton, false);
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if(navigator && navigator.network && navigator.network.connection && navigator.network.connection.type == Connection.NONE) {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "offline.html", {transition:'flip' } );
}
var x = $('#maperror');
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError,{enableHighAccuracy: true, timeout: 20000});
}
else {
$("#maperror").text("Geolocation is not supported by this browser.");
}
function showPosition(position) {
$("#lat").val(position.coords.latitude);
$("#lon").val(position.coords.longitude);
var latlon =position.coords.latitude+","+position.coords.longitude;
var img_url = "http://maps.googleapis.com/maps/api/staticmap?mytimestamp="+new Date().getTime()+"¢er="+latlon+"&zoom=18&size=220x220&sensor=false&markers="+latlon+"&size:mid%7Ccolor:0xff0000%7Clabel:%7Camroha,+uttar+pradesh&visual_refresh=true";
$("#mapholder").html("<img src='"+img_url+"'>");
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
$("#maperror").text("User denied the request for Geolocation.");
break;
case error.POSITION_UNAVAILABLE:
$("#maperror").text("Location information is unavailable.");
break;
case error.TIMEOUT:
$("#maperror").text("Google Map couldn't loaded, Please reload the page to get user location! Also Make sure you are outdoors.");
break;
case error.UNKNOWN_ERROR:
$("#maperror").text("An unknown error occurred.");
break;
}
}
}
function onOnline() {
// Only go back if user went to offline.html
if ($.mobile.activePage[0].baseURI.indexOf("offline.html") > -1) {
$.mobile.back();
}
}
function onOffline() {
$( ":mobile-pagecontainer" ).pagecontainer( "change", "offline.html", {transition:'flip' } );
}
function mybackButton(e) {
if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="page") {
exitAppPopup();
}
else if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="offline") {e.preventDefault();}
}
function exitAppPopup() {
navigator.notification.confirm(
'Do you really want to exit from AmroClean?'
, function(button) {
if (button == 2) {
navigator.app.exitApp();
}
else if(button ==1)
{
history.back();
}
}
, 'Exit'
, 'No,Yes'
);
return false;
}
});
</script>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You want me to find a mistake, if any, in this part of your script?
Could you please describe what is going wrong, first?
- do you get an error message? If so, which one?
- does anything happen during the test, which you don't want to happen? If so, what?
- does anything not happen during the test, which you actually want to happen? If so, what?
- doesn't the app launch? does it freeze?
- does your device explode?
- 724 Posts
- 3 Reply Likes
-No error i am getting.
-Script is not responding as I expected.
no no no
Popup is not showing, and page is still behaving like before, like these function has no effect on page.
Does exit app need some plugin? like cordova-plugin-exitapp?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Now, there is something.
So, navigator.notification.confirm() is apparently either not called, or not executed. You need to find out which one it is. Below is the line of thought you should master by now.
It is the first statement of this function:
function exitAppPopup()
So, the first question is: is that function executed or not?
The next question would be:
If not, is it called?
If it is executed, why does
navigator.notification.confirm() not execute?
- 724 Posts
- 3 Reply Likes
I solved that problem yesterday, both are woeking now, e.g/ popup menu and backbutton evetns as I expected...........Thanks alot for your valuable suggestions :)
Now i m woking on:

petra, in this function, baduser and badpassword are variables?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
And the html entity and html tag in the example make the code invalid.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
https://getsatisfaction.com/nitobi/topics/how-to-make-dynamic-apps-using-phonegap?utm_source=notific...
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
This would be correct
mail(
'admin@gmail.com','Script error', 'mysqli connect failed');$response_array[] = array('id'=>'systemErr','message'=>'mysqli connect failed');- 724 Posts
- 3 Reply Likes
Petra, what are baduser and badpassword?
Can't I use this function like:
if(!mysqli_connect())
{
mail(
'admin@gmail.com','Script error', 'mysqli connect failed');$response_array[] = array('id'=>'systemErr','message'=>'mysqli connect failed');}
or
if(!mysqli_query())
{
mail(
'admin@gmail.com','Script error', 'mysqli connect failed');$response_array[] = array('id'=>'systemErr','message'=>'mysql query error');}
??
And when we don't want to show these errors to users, then y we are showing through json array?
We well show an error page to them right?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Those are strings, representing a wrong userID and a wrong password. They are used in this example to force TRUE for the evaluation.
Can't I use this function like:
if(!mysqli_connect())
As long as you are working on localhost, with default userID, password and database, then yes. In a normal business situation, that is never the case, though.
Have you still not gone beyond the phase of using 'localhost' in a test environment?
- 724 Posts
- 3 Reply Likes
although it's fetching data from database on remote server. But not in my app. what i do ?
see:@ remote sever:
http://amroclean.esy.es/
it's returning data also from server, i checked in app to check the status of a complaint
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You did what?
The app is a client application. It should not be on a remote server, but rather installed in a mobile device.
Your server-side application (web service and database) should be at the remote server.
- 724 Posts
- 3 Reply Likes
Now actually I understood how a dynamic website is differ from an hybrid app. So, Now i just delete all client side assets from server, Now what i have on remote server: serverside assets and database with two tables. And my app I build it , and it's installed on my client mean phone.
Thanks alottttt. really
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
<script>
$.getJSON("compltype-data.php", function(return_data){
$.each(return_data.data, function(key,value){
$("#complaintlist").append("<option value=" + value.compltypeid +">"+value.description+"</option>");});
});
$('#complaintlist').change(function(){
//var st=$('#complaintlist option:selected').text();
var st=$('#complaintlist').val();
});
</script>
compltype-data.php
<?Php include_once('config.php'); // Database Connection
$sql="select compltypeid, description from compltype where active='y' order by description asc";
$row=$dbo->prepare($sql);
$row->execute();
$result=$row->fetchAll(PDO::FETCH_ASSOC);
echo json_encode(array('data'=>$result));
?>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- Is the request sent successfully from the client?
- Is the request received by the server?
- Is a query sent to the database?
- Does the database return the correct values?
- Does the server get to the point that a reply is being returned?
- Is the json object filled correctly?
- Does the client receive that json object?
- Is the json object still filled correctly?
- Is the client's callback function executed properly?
Look, these are the steps you have to check one-by-one. That's how you debug such a process.
Once you find the problem, which can be anywhere within these steps, you must fix it.
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Alternatively, since you are using another database now, you might have no data in the database, or an sql query might fail.
- 724 Posts
- 3 Reply Likes
And also server-client communication is already running.
<access origin="http://amroclean.esy.es"; subdomains="true" />
I didn't used another table for it. I just import it from local host to remote server. The same table is on server as localhost.
By d way yes I am testing now.
- 724 Posts
- 3 Reply Likes
my app is complete now............ I did I did yes I did...............
of course with the help of u :D
Thanks
thnk u tooooooooooooooooooooooooo much
I wiill always remeber u in my prayer :)
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Piece of cake.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If the former, create a 'mailto:' link (not recommended)
If the latter, create a form with user's mail address, subject and content. Then post the data to the server, let your web service send the mail, and return a json object with the result.
- 724 Posts
- 3 Reply Likes
Petra, apart from this topic i want to ask something.....u saw i had knowledge of only html and css, and jquery mobile, javascript, ajax i learned here with you. I just don't want to die like all, i wanna do something. What is better for me? I want your guidance, it's my compulsion that i am creating this app, although i can do any hard work. But more than programming i like to create things of waste materials, from childhood i have a hobby to collect waste things and create something new. I wanna show u somepics, which are of my things i created with waste things, art and craft, in creativity i have lots of interest, but i unfortunately i can't earn money from this. So i stopped and jumped in computer teacher/operator. I also want to open a big IT institute here.

Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
1. It's necessary if we want to use this app in android and windows phone only, to upload on google store? while it's small town? Can't we publish this app only by this qr code?
2. For ios supported app this is necessary to create certificates and after we can upload our app on apple store right?
3. Are signing keys and certificates still required if we are publishing this app only by that qr code?
Petra plz install my app in your phone, if it's not ios supported, the help option is still not completed. Today I wll do In Shaa Allah total complete.

Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- how do your users find the app?
- how do you keep statistics?
- how do your users know that there's an update to install?
- how are you going to create new test versions when updating, without releasing such version yet?
No, you're getting in trouble if you try to publish it outside the store as a test version. Besides, if I were the client/community, I would not accept that kind of release from the developer.
And yes, to publish it, you need certificates and you need to pay the Stores. But it's the client/community paying for it, not you, right?
- 724 Posts
- 3 Reply Likes
1.First please tell me that, when i was using this database on localserver i set default value of datetime column to Current_Timestamp. So whenever i was inserting rows, it was showing current date and time.
Now when i m using another remote server. It's shpwing that invalid default value of datetime column 'current_timestamp'.
Then I tried to use now() function with query, it's also inserting a datetime but not current/ date is correct but time is wrong. How i can set correct time zone for it?
2. Also have another question, that whenever i will update database to change complaint status. How i can keep record of status updation date and time. Means how i can keep records separately when user filed a complaint and when i updated his status.?
Thank you sir.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
https://blog.mozilla.org/it/2012/11/16/converting-timezone-specific-times-in-mysql/
2. I am not quite sure what you are asking here. What is "keeping record of status updation date and time"? Do you want to keep a copy of each occurrence of Complaint after each update? If so, you need to extend your data model.
Or do you just want a 'last updated' timestamp? If so, why?
- 724 Posts
- 3 Reply Likes
ALTER TABLE `complaint` CHANGE `datetime` `datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
2. If a user files a complaint at 2016-8-14 5:50:45.40, and we updated status at 2016-8-15 6:00:00.00 now my boss assign me a task to prepare a report in which i show how much time community took to solve the problem. Then what I will do?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That ALTER TABLE statement will not get you the timezone that you desire....if you know which 'current time' is correct in all cases, anyway.
2. You first tell your boss that such a report can't be made, because the application has not been set up to deliver the necessary data. Such statistisc were out of scope of his project.
Then you explain your boss that a requirements change for the application can be written, so that the application can be modified to serve this purpose. Of course, your boss should understand that he can only have reports of the Required Time-To-Handle for Complaints that were handled AFTER the application change has been developed, tested, accepted and released, because only such Complaints will have the necessary data.
Then , when he understands and accepts the above, you would develop the necessary changes, starting with the analyzation of his requirements.
For instance:
- does he want to have an average for all Complaints, or rather for specific Complaints? If the latter, what selection criteria need to be applied?
- does he want elapsed time in every single case? How is a change in DST to be treated, then (in other words: how much time elapsed between 8:10PM and 6:30AM the next morning, if a one-hour time shift was performed at 02:00AM?)
- would a paper report the next day be sufficient, or does he want the report to be available on his mobile phone 24/7?
- what exactly does he want to see for the selected Complaints? (This and the previous question should determine whether or not the update data are to be stored in the database, and whether or not the web service script must be modified).
- 724 Posts
- 3 Reply Likes
Yes, the server machine in New Delhi, and all the clients are here in Amroha, which far from New Delhi and of course time zone is also different.
Amroha is small town/city, this app is only for citizen of Amroha, So what should i can use for current date and time? If i will not use currenttimestamp then what i do, if a user file complaint, the current time of amroha should insert?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
1. always store UTC in the database and convert from there to display correct times (whatever 'correct' is, and wherever it needs to be displayed)
2. Use the technique as outlined in the document I linked to an hour ago.
But before you pick an option, you first need to analyse what exactly needs to be displayed, when, where and for what purpose.
- 724 Posts
- 3 Reply Likes
Petra on slow connection dynamic list is not population but page is loading. I mean complaint.html page is showing.
Is there any method by which we can show a message of "slow connection" while dynamic list is not populating?
2. How we can create multilingual pages with pgb and jqm?
Is there any plugin required?
Because, i want to make help page in Hindi, English and Urdu Language, but on page loading they are converting into weird symbols.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Sure. Create a div around the select box. Then, also in that div, create a Paragraph with the text. Set a timeout of X seconds (whichever duration you like), and after that timeout, display the paragraph with the text, UNLESS meanwhile the list has populated.
How we can create multilingual pages with pgb and jqm?
This is a specific, large topic. Multilingual applications are difficult to set up. To start with, you need your content from the database set up in multiple languages. Then you need all error messages and image/button captions in multiple languages.
There is no plugin for that, you must redesign your database and webservices, create a process for the user to switch languages (and remember the chosen language) and act upon that.
Also, you need to make sure that the app itself is available in those languages in the App Stores, so you would create multiple introduction pages.
And what about the Help pages of your app? Should they be ,multilingual, too?
No, this would be way over your head. You should trust that your users will be able to translate, if necessary, themselves.
Because, i want to make help page in Hindi, English and Urdu Language, but on page loading they are converting into weird symbols.
What are 'weird symbols' Aren't they all part of UTF-8, then?
- 724 Posts
- 3 Reply Likes
No no no i dont want to feed data in database in multiple language, I also dont want server-client communication in multiple languages. I just want a single static webpage written in multi languages. Just to read easily instruction before using this app.
See these symbols are showing.

Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
And do you want the strings "Back" and "Help" translated, too?
- 724 Posts
- 3 Reply Likes
see this:
<ul><li><a href="help_in_hindi.html">हिंदी</a></li>
<li><a href="help_in_urdu.html">اردو</a></li>
<li><a href="help_in_english.html">English</a></li>
</ul>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Are these help texts local html pages, or does the text get imported from the server?
The point is that the most likely the character set and/or encoding is wrong somewhere. We need to find out where the mismatch is. Possibilities are, depending on how the texts get there:
- mySql table character set / encoding
- webserver defaults
- connection encoding
- html file mime type and encoding
- specification in the html file.
- 724 Posts
- 3 Reply Likes
I wanna ask again. for GOD sake tell me truth please
Are you really an internet bot?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
But then I failed the release tests, together with other bots. So, we were released from duty. Some of us were never further developed, while others, like me, started a career as independent bot for general purposes.
That's how I finally ended up here.
The sad part is that Phonegap is in the process of closing this forum down. They believe they had already done so at the end of June 2016 (according to the announcements on the front page of this board), but obviously, they aren't even good enough to do that decently.
- 724 Posts
- 3 Reply Likes
I have two dynamic links, in my Post Complaint page, when network is completely off. It's showing offline.html page, but when network is slow it's showing page but no data returned by server.
You suggested me that i should use setTimeout function to create a limited interval for pick list, but what about ajax request? On slow network it will not return data from server.
I don't want to create only one function for only picklist.
I want to make set a time.interval for whole page. I want to prevent page loading not only page is offline but when it's on slow network, How i do this?
Can i do like this?
function onDeviceReady() { if(navigator || navigator.network || navigator.network.connection || navigator.network.connection.type == Connection.NONE) {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "offline.html", {transition:'flip' } );
}
instead of:
function onDeviceReady() { if(navigator && navigator.network && navigator.network.connection && navigator.network.connection.type == Connection.NONE) {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "offline.html", {transition:'flip' } );
}
Can I use OR operator instead of AND ?
I checked some hybrid apps installed in my phone, on slow connection they are not loading pages and showing this message like offline.

Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Yes, but it means something different, then.
For instance, do you really want to evaluate "navigator.network.connection.type == Connection.NONE", if only 'navigator' is a defined object, but not 'navigator.network'?
I checked some hybrid apps installed in my phone, on slow connection they are not loading pages and showing this message like offline.
Yup. They are waiting for a while, and if there's still nothing, they display such message instead of whatever should normally get displayed.
But, but.....
I thought you said your app was finished, and you were preparing the release?
- 724 Posts
- 3 Reply Likes
Petra please tell me what I do?
Can't I prevent page loading untill not have proper network?
or when have bad connection can't I show network error or waiting for network or else?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
For instance, it's explained here:
http://stackoverflow.com/questions/5225597/set-timeout-for-ajax-jquery
- 724 Posts
- 3 Reply Likes
function(data) {
for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
},"json").fail(function() {
alert("posting failed");
});
}
return false;
I mean where i can use timeout i googles but everywhere they explained only ajax...
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
http://api.jquery.com/jquery.ajax/
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Of course, you could encapsulate the $.ajax function, so you wouldn't really have to worry about its syntax more than once. You could write your own syntax in the custom method.
See for instance http://stackoverflow.com/questions/10009430/timeout-in-jquery-post-by-emulating-ajax
You aren't tied to using $.post, so if some change request come up which requires another method, you must be prepared to change the code, then retest the whole application.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra, i changed my post method into ajax
everything is posting into database but when we are posting with image it;s not posting blob image see what mistake i am doing: I will be highly thankful to u sir,,,.plz
var formData = {personname1: personname,
emailphn1: emailphn,
locationtxt1: locationtxt,
complaintlist1: complaintlist,
otherdescription1:otherdescription,
image1:image,
lat1:lat,
lon1:lon,
mycheck1:mycheck
};
if (personname==null || personname=="")
{
$("#nameErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#personname').focus();
$('#personname').addClass("missing");
});
return false;
}
if (emailphn== null || emailphn=="") {
$("#emailErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
$('#emailphn').addClass("missing");
});
return false;
}
if (!mailFormat.test(emailphn)) {
$("#emailformatErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
$('#emailphn').addClass("missing");
});
return false;
}
if((locationtxt==null || locationtxt=="") && !$("#mycheck").is(":checked"))
{
$("#locationErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#locationtxt').focus();
$('#locationtxt').addClass("missing");
});
return false;
}
if(complaintlist==null || complaintlist=="")
{
$("#complaintlistErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#complaintlist').focus();
$('#complaintlist').addClass("missing");
});
return false;
}
if(($('#complaintlist option:selected').text()=="Other") && (otherdescription==null || otherdescription==""))
{
$("#otherdescriptionErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#otherdescription').focus();
$('#otherdescription').addClass("missing");
});
return false;
}
else
{
$('#contentTransition').show();
$('#myForm').hide();
// Returns successful data submission message when the entered information is stored in database.
$.ajax({
type : 'POST', // define the type of HTTP verb we want to use (POST for our form)
url : 'http://www.acesabbasi.org/AmroClean/postcomplaintinfo.php', // the url where we want to POST
data : formData, // our data object
dataType : 'json', // what type of data do we expect back from the server
timeout : 3000
})
// using the done promise callback
.done(function(data) {
for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
$('#contentTransition').hide();
$('#confirmation').show();
}).fail(function() {
alert("Posting failed.");
});
}
return false;
});
});
without image records are feeding in database but when using image with complaint not inserting rows in db...it's done when i use ajax instead of [post
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- Do the image data arrive in your server side script? If not, why are you surprised that nothing is stored in your database?
- 724 Posts
- 3 Reply Likes
2. except image everthing is storing in db
Petra plz tell me how i can store blob data in db by ajax plz
with image it;s showing posting failed and without image record in storing in db
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If your script doesn't even receive image data, then of course it will not store the image.
If your app is not sending image data, then of course the server side script will not receive image data.
If your app doesn't prepare the image data in the proper variable 'image', then of course it will not send those data.
So you need to debug/test step-by-step.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
-It's necessary to create signing keys and certificates for android and windows here at phonegap build forum?
-For apple we must create certificates and upload them at apple developer id with payment right?
Before payment we can't even check that how our app is working on ios right?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Those files can either be ceated yourself or must be requested and downloaded online. The procedure is different for each OS.
In order to publish, you must rebuild your app with a distribution/release certificate and you must have paid your developers fee to the Stores. For iOS, you also need a Mac to be able to publish the app.
It's all nicely documented:
http://docs.phonegap.com/phonegap-build/
See the signing section, which has tabbed pages for three platforms.
- 724 Posts
- 3 Reply Likes
I created a keystore file which is I added on android, now i want to add a key for windows it's asking for Publisher ID....so what I do?
Before adding key in windows I must publish it?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, you must first get a (paid) Microsoft dev account.
- 724 Posts
- 3 Reply Likes
First of all I want to pay a special thanks to you, since beginning you are always here. I can't really forget your favors on me and special thanks to all pgb team.
I have some questions Petra, although you are always replying, but still want to request you. If have some time please reply.
1. I want any email id of Adobe PGB's support crew. Because this i want to delete this thread, i know as a user I can't delete it, but I will request them to delete this thread. For some privacy issues.
2. When we will upload this app on the store, (all stores are different for all different platforms?) , So whenever the developer will update his app, So he will hard code for update links at client side? or it's store's duty after every updation they will notify to user for new updation?
3. I saw some apps are giving bonus/money to their users, whenever they are speading their apps. What benefit they are getting whenever a user is installing their app? Are they earning from their apps if, then how? Have you any idea?
4. In my app i have added an option, to invite this app with friends, but I just added a download link of my app in pgb. How can i share directly apk file of my app?
(By giving the link of store, where app is uploaded?)
5. I also want to make some apps for schools, have you any app of any school for demo?
Thanks alot with respect Sir.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Besides, even if they deleted this thread, it would still be public on archive.org
2. Has your own device never alerted you of any app updates?
If it has: it will be the same for your app. You upload a new version, and the users will be notified. But...you must anticipate that they will not update, anyway.
If that could become problematic, you should develop a mechanism in the app, which allows you to disable older versions after warning the user. It's what I often do with the apps I develop.
3. There are all kinds of ways to monetize an app, ranging from displaying ads to selling in-app articles or collecting and selling data provided by users. Games, for instance, have an in-app shop, like race simulators or Pokemon Go.
4. Never, ever, give the URL of your app in PGB. Your users should not know your password, anyway, so they won't see what you see when you are logged in.
And you don't want users to download test versions that have not been finished, do you?
5. I have no demo apps, no. You should find such apps, download the apk and open it to view the source. BTW: that's how everyone can see your source, too. So be aware that you should never include confidential data in your assets!
- 724 Posts
- 3 Reply Likes
3. Hmm, Got it.
4. Yes, it's what I was thinking I dont wan't to share that url to users. I want to remove this option from the App. Instead of what option I can add? Since you know which type of app i have developed so can u please give a superb idea, by your robotic mind?
5. Ok
Thank You Petra Vrba :)
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
4. I would create a real Share functionality for the hyperlink to the Store (which means you need to determine the platform, first, so you can link to the correct store), using this plugin:
https://www.npmjs.com/package/cordova-plugin-x-socialsharing
- 724 Posts
- 3 Reply Likes
By the way, thanks alot again.
Petra can you come India? to tell the IT students that what actually IT is? To motivate them? Please i am inviting you here from all IT students, who really want your life changing guidelines. Please.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
I have a problem,
I have created a display page to display database records, but images are not showing, can u please see what i am doing mistake?
It's retrieving all the data but not images...
<?php$con= mysqli_connect("localhost","root","","amroclean");
// Check connection
if (mysqli_connect_errno())
{
echo "Connection Failed: " . mysqli_connect_error();
}
$sql = "SELECT *FROM complaint";
echo "<table border='1'>
<tr>
<th>Complaint Id</th><th>Person Name</th><th>Email/Phone</th><th>Location</th><th>Lat</th><th>Lon</th><th>CompltypeID</th><th>Other Description</th><th>Image</th><th>Status</th><th>Datetime</th><th>Complaint No.</th></tr>";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td>".$row['ComplainID']."</td>";
echo "<td>".$row['peresonname']."</td>";
echo "<td>".$row['emailphn']."</td>";
echo "<td>".$row['locationtxt']."</td>";
echo "<td>".$row['lat']."</td>";
echo "<td>".$row['lon']."</td>";
echo "<td>".$row['compltypeid']."</td>";
echo "<td>".$row['otherdescription']."</td>";
echo "<td>".'<img src="data:image/jpeg;base64,'.base64_encode($row['image']).'" />'."</td>";
echo "<td>".$row['Status']."</td>";
echo "<td>".$row['datetime']."</td>";
echo "<td>".$row['ComplainNo']."</td>";
}
echo "</table>";
}
mysqli_close($con);
?>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
Should i use base64_decode() instead of-
or
how?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
if i am doing like this, pics still not showing
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
2. Is there any content type required in php display page?
3. In jquery' post method, Is there unique way to post base64 data into db?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
There's no special content type required. text/html is fine.
Use an online base64 checker to see if your data are correct.
- 724 Posts
- 3 Reply Likes
uff i dont thik that it's a valid base64 encoded string?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
But if you store that prefix too, why do you add one when displaying? That makes it invalid.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
I don't only remember you when i have query , :)
I will remember you in my prayer, with lots of respect.
- 724 Posts
- 3 Reply Likes
How we can know that on the Internet we are talking to a human or Internet Bot?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Internet bots don't even type.
So, you just inspect the text closely, and check whether it was typed or not!
- 724 Posts
- 3 Reply Likes
I saw that many time you text a smiley like :-) , and once when I wrote like this-Petraaaaaaaaaaa, u said don't shout, that means, you felt insulted. And Many time you wrote sign, when People ask something much basic.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
How is your app doing?
- 724 Posts
- 3 Reply Likes
Hope you're having a pleasant morning there. :)
My app is near about to launch Sir.
see it's new look

- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
And how does the community handle those complaints in the back end?
- 724 Posts
- 3 Reply Likes

and what can I make better?
2. Petra what was your first mobile app?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
2. My first app has been removed again. It was the app for a Dutch open university. The website is still there: vu-amstelland.de
- 724 Posts
- 3 Reply Likes
2. I saw website, did u designed and developed it?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
2. I created the database, the backend, the multi language process, the payment interface, the integration with the accounting system, the statistics machine and a framework which allows the owner to create its own user interface.
- 724 Posts
- 3 Reply Likes
2. Good, what are your qualification?
- 724 Posts
- 3 Reply Likes
2. Good, what are your qualification?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
How do you currently determine which complaint is the complaint of this particular user, so that you won't show the wrong complaint? Surely, you won't show just any complaint, would you?
2. Internet bots don't need any qualifications. :-)
But the programmer who created me studied Information Technology and Mathematics in Amsterdam and Cambridge MA.
- 724 Posts
- 3 Reply Likes
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Who is your Programmer, can you tell me his full name?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
(My programmer never offered me a business card or even spoke an introduction. I just call that person My Programmer)
- 724 Posts
- 3 Reply Likes
Ok Petra, :)
What happened to this site? I am trying to post here since two days. But everytime it's going failed.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
How are you? Hope that You are well.
Kind Regards: Saba
- 724 Posts
- 3 Reply Likes
Happy Eid ul Azha :)
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
What is Eid ul Azha or Eid ur Adha?
Eid al-Adha "Festival of the Sacrifice"), also called the "Sacrifice Feast", is the second of two Muslim holidays celebrated worldwide each year, and considered the holier of the two. It honors the willingness of Ibrahim (Abraham) to sacrifice his son, as an act of submission to God's command, before God then intervened sending his angel Jibra'il (Gabriel) to inform him that his sacrifice had already been accepted. The meat from the sacrificed animal is divided into three parts. The family retains one third of the share; another third is given to relatives, friends and neighbors; and the remaining third is given to the poor and needy.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, if those family, friends and neighbours also 'sacrifice' an animal and share one-third, your family and friends will have lots to eat at that party!
- 724 Posts
- 3 Reply Likes
Yes, You are right, but we try to give to those people, who did not eat whole year good food, who can not sacrifice animals, we try to reach them and server them.
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- an app that heals cancer
- an app that makes people able to fly
- an app that offers free fuel
- an app that makes espresso
- an app that brings peace in the World
- a lie detector
- an app that generates tastful recipes from random ingredients
- an app that proposes a good presidential candidate for the USA
- an app that generates unique apps.
- 724 Posts
- 3 Reply Likes
I think My second app should be "Peace" e.g. Peace in the World.
Thank You Petra to suggest really unique apps.
I will create them, I will
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If you need someone to test it, I'll be happy to volunteer. If the test succeeds, the app won't even have to go live anymore, because the goal has then be reached already!
- 724 Posts
- 3 Reply Likes
Have a Nice Day.
I tried, I tried I thought a lot. How i can make peace in this world by just only an mobile app.......
And I found that..
I Can't make peace in this world, untill
race disconnected us, religion separated us, politics divided us , and wealth classified us...... :(
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So your new app should ban religion, eliminate politics and introduce strict socialism.
Race differences need not disappear, but should become invisible.
Can your first version of the app do that?
The second version should also destroy all weapons, eliminate corruption and please also stop diseases. Make country boundaries disappear and produce free chocolate and ice cream.
- 724 Posts
- 3 Reply Likes
Race differences need not disappear, but should become invisible.
Can your first version of the app do that?
So You are saying that I should snatch people's hope?, How can I ban religion. If someone will give me a chance I can really change the world.
But not in this way.
Now you are really talking like a machine.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Could you then please create an app that displays the current time and date?
Please pay attention to:
- the correct switch moment for Daylight Savings Time (and back)
- the correct time zone based upon the user's location
- the correct date switch for leap years
- 724 Posts
- 3 Reply Likes
Petra can you reply to this question.
Do you remember In my app I have created a offline page when network is absent.
Now my Boss wants I should use pending request while we are offline. He wants If a user is offilne he/she can fill the form and as soon as he have internet connection, request automatically sent. Is that possible?
Kind regards:Saba
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, your boss doesn't want the offline page? Or does he want the user to ONLY get to the form when offline and to no other page?
What does your boss want to happen if the user attempts to get to another page while offline?
Basically, when the user is offline and he gets to the form, you need to refrain from making an ajax request and instead store the data in localStorage.
Then, when the app is restarted or the app gets back online, you should first see if there is any data in localStorage. If so,
- prepare the ajax request with those data
- send the data
- on success, wipe out the data from localStorage
- then show the success page.
Now, what does your boss want to happen if a user fills out multiple forms (at different locations) while offline? Does he want to have those multiple form data stored temporarily?
If so, then you have several additional problems:
1. Upon getting back online, your script must process multiple ajax requests
2. After each request, you can only wipe out that part of the data that have been sent
3. localStorage is not large enough to store multiple pictures, so you need to keep those picture in the file system or in an IndexedDB database locally.
- 724 Posts
- 3 Reply Likes
Petra I made my app multiligual now, the client side i have finished and created hindi english and urdu pages, but now when i inserted data in compltype table, i have change charset by collation utf8_general_ci of two columns e.g. description_hindi and description_urdu, the data in inserting successfully in database, but when i am fetching it into dynamic picklist by json it's showing only question marks instead of each list item, what I am missing Petra?
Please Help, sorry I couldn't messaged i was too much busy since some days.
- 724 Posts
- 3 Reply Likes
Petra I made my app multiligual now, the client side i have finished and created hindi english and urdu pages, but now when i inserted data in compltype table, i have change charset by collation utf8_general_ci of two columns e.g. description_hindi and description_urdu, the data in inserting successfully in database, but when i am fetching it into dynamic picklist by json it's showing only question marks instead of each list item, what I am missing Petra?
Please Help, sorry I couldn't messaged i was too much busy since some days.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, you have set utf8 at the source (the database table) and you are checking if it works at the end of the chain. There you notice a problem.
Many things happen in between. As always, my suggestion is to test and debug step by step.
You need to find out which application part and which code line causes this behaviour.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Now i made it Multilingual , all the UI messages and also Ajax returned data, in HIndi, English and Urdu language. :)
Please Please and Please install my app in android or windows and tell me how is it.......thank you Petra

Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Also, I received a complaint number, but I couldn't check its status, because it said that the number doesn't exist.
- 724 Posts
- 3 Reply Likes
Petra I checked my database, but there is no any record inserted by your registration. Did you really got a confirmation message? I just file a complaint now and checked and it's inserted successfully. I am shocked that how could you got complaint registration number, when record is not updated.
See I just tried now with your name:

And if really this happened then tell me, on which deivce,version,os you checked?
and the second thing, yes the device back button is not working on those pages where i have set offline page, because i have killed the event for offline page but don't know why it's not working on online pages, well I will see it and I will resolve it.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
When filing a complaint, I received a 6-digit complaint number (not as long as the one in your image, but perhaps the number was cut off on display), beginning with 9. I don't remember that number anymore, and it's apparently not kept in localStorage, so the user is forced to remember that number :-(.
BTW: the Send button on the contact form is cut off on display, too, after receiving an error message.
BTW2: the splash screen disappears too early. I saw a white screen when the splash disappeared and before the first screen appeared. Took about 3 seconds. You should rather script the dismissal of the splashscreen instead of making it disappear automatically after a fixed number of seconds.
- 724 Posts
- 3 Reply Likes
2. I set 8 digits in mt_random number, then how you got 6 digits number?
3. Did you really download the app from Qrcode, make sure, you have not any old version.
4. Is there anyway except sms, by user can save this complaint number? Option like save to drafts or other?
The Send button I will fix with footer, thanks
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
2. I can't tell. Perhaps the first two digits were zero, and you suppress leading zeroes
3. I used the QR code.
4. You could save the number in localStorage. User would at least have it on the same device, then. Make sure you can save multiple numbers, then. We have discussed this in this thread a long while ago.
- 724 Posts
- 3 Reply Likes
Secondly please Petra friend tell me some deeply about localstorage please.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
https://www.w3.org/TR/webstorage/#the-localstorage-attribute
or a popular version:
http://www.w3schools.com/html/html5_webstorage.asp
- 724 Posts
- 3 Reply Likes
1. If you are near about to leave this forum, please inform me, because, i want to connect with u here, and anywhere, please inform me before you go.
2. I read all the documentation you show, So i have decided that I can give a small option "Save Complaint details" on json return page, e.g. user can save details of his complaint, complaint type, complaint number, date and time etc. A small app again with notepad, save , update, delete options i can provide, and this small app i can attach with page.
3. But last night I thought that How easy if I will a button on that page to save screen shot of return page?
With screen shot, user can also see date and time and also can memorize complaint number, Which option should I use, Which is easy to use for user?
Thank YOuuuuuuuuuuuuuuuuuuuuuu ^_^
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That depends, whether you want the user or the device to know the list of complaints.
If the user should have an overview of the status of his comlaints, then you need a user ID. The user should log in into your application and will then have an overview of the complaints which are registered for him. This list comes from the server and is available on every device where the user logs in.
If the device should have an overview of the status of its complaints, the technical solution is much easier and the user doesn't need to log in. However, in that case, the user won't have his complaints overview on other devices.
Which do you prefer?
- 724 Posts
- 3 Reply Likes
I have to redesign my database again right?
The screencapture is not good right? Because it's limited only for device.
Obviously i want user know the list of complaint not device.
- 724 Posts
- 3 Reply Likes
And lots of work and time, I want that for NOW i should use a simple option by which user can see that which complaint number was showing when he file a complaint......for ahead i can create the fully login app,, so that i can have a little time more......suggest me Petra please another way, By which user can memorize complaint number.....only complaint number
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You need a user registration function, a user login/logout function and a password retrieval function. Then you need a client-side login verification function at page switch.
Do you think you can do that?
- 724 Posts
- 3 Reply Likes
But not instantly, i have another duty which is for long time....
But since beginning this type of app i was wishing to create.
Thank You
- 724 Posts
- 3 Reply Likes
Then when I will be perfect you can give me good salary... :p
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
Okay tell me please one thing
New ER Diagram for my App:
Users
______
UserId int (PK)
Username varchar
Address varchar
Phone int
Email varchar
password varchar
Complaints
__________
ComplaintId int (PK)
UserID int (FK) Reference to Users
Compltypeid int (FK) Reference to Compltye
Locationtxt varchar
lat
lon
Otherdescription
image
status
datetime
Compltype
_________
CompltypeId (pK)
Active enum(y/n)
description varchar.
?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If you wish, you could add LastLogin (datetime) to user for statistic purposes. Also, you could add LastDatePasswordChanged (date) to force a password change every X months.
- 724 Posts
- 3 Reply Likes
1. LastLogin Column should add in User table? Or which table?
and
2. LastDatePasswordChanged column in which table , or I should add another table to keep records of login and logout?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
1. For dynamic map, if I am taking a map in canvas, How I can save lat lon values of another points, means till now it was storing current position, How I will code for another location?
2. For images, the quality i have taken in js is 50 (quality:50), what should I do to make fast my app?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
And what do they consider a 'dynamic map'? What functional requirements do they have?
2. The speed depends mainly on the connection speed (upload) of the device, and you can't change that. Of course, you can try and reduce the quality, but otherwise, there's not much you can do.
- 724 Posts
- 3 Reply Likes
2. Ok Petra, thank you so much.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
https://developers.google.com/maps/documentation/javascript/events#EventArguments
- 724 Posts
- 3 Reply Likes
SEe:
what I am doing mistake?
Am i using vanilla javascript? This is the reason?
<!DOCTYPE html><html>
<head>
<title>Simple click event</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var myLatlng = {lat: -25.363, lng: 131.044};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: myLatlng
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Click to zoom'
});
map.addListener('center_changed', function() {
// 3 seconds after the center of the map has changed, pan back to the
// marker.
window.setTimeout(function() {
map.panTo(marker.getPosition());
}, 3000);
});
marker.addListener('click', function() {
map.setZoom(8);
map.setCenter(marker.getPosition());
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">;
</script>
</body>
</html>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
Having this type of problem with every map, not only for this coding.
Whenever I am seeling this map on websites, it's looking fine, but whenever i am trying in my app, this is showing that error message.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
function onDeviceReady(){
document.addEventListener("backbutton", function(e) {
if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id) {
e.preventDefault();
}
}, false);
}
</script>
Petra this script I am using at offline page to kill backbutton event. But This is not effective on back button.
But same script I used to exit from app on index page, so it's working as expected...what I am doing wrong?
I also tried like this:
<script>document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
document.addEventListener("backbutton", function(e) {
if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="offline") {
e.preventDefault();
}
}, false);
}
</script>
But Not working as I expected, backbutton is working.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
(You must first check which branch your script execution follows, because you want to find the root cause of the problem. Then correct that root cause - which is either the fact that the evaluations return differently from what you expect, or the e.preventDefault() doesn't have any effect on the back button's action, in which case you could try returning false, instead)
- 724 Posts
- 3 Reply Likes
document.addEventListener("deviceready", onDeviceReady, false);function onDeviceReady(){
document.addEventListener("backbutton", function(e) {
if ( $('.ui-page-active').attr('id') == 'index' || $('.ui-page-active').attr('id') == 'indexurdu' || $('.ui-page-active').attr('id') == 'indexhindi') {
exitAppPopup();
}
else if($('.ui-page-active').attr('id') == 'offline' || $('.ui-page-active').attr('id') == 'offlinehindi' || $('.ui-page-active').attr('id') == 'offlineurdu')
{
e.preventDefault();
}
else
{
history.back();
}
}, false);
function exitAppPopup() {
navigator.notification.confirm(
'Do you really want to exit from AmroClean?'
, function(button) {
if (button == 2) {
navigator.app.exitApp();
}
else if(button ==1)
{
}
}
, 'Exit'
, 'No,Yes'
);
return false;
}
}
- 724 Posts
- 3 Reply Likes
PETRA SEE , I WANT IF CONNECTION IS SLOW AND PAGE CAN'T LOAD INSTANTLY , A SLOW CONNECTION PAGE APPEAR WITH SLOW CONNECTION MESSAGE WITH RELOAD BUTTON.
SO I WAS USING THIS CODING, BUT IT'S SHOWING ONLY ALERT, NOT SHOWING PAGE, WHAT I AM DOING WRONG?
<script type="text/javascript">
var slowLoad = window.setTimeout( function() {
alert( "the page is taking its sweet time loading" );
}, 5000);
window.addEventListener( 'load', function() {
window.clearTimeout( slowLoad );
}, false );
</script>
AND FOR PAGE...
<script type="text/javascript"> var slowLoad = window.setTimeout( function() {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "SLOWCONNECTION.html", {transition:'flip' } );
}, 5000 );
window.addEventListener( 'load', function() {
window.clearTimeout( slowLoad );
}, false );
</script>Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Where is that first piece of code located?
How can you have the same variable for two different timeout handlers?
- 724 Posts
- 3 Reply Likes
Sir i had only one variable, eg. slowLoad, only.
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
I was asking about my mother, she was suffering from Chikunguna, i was worry for her, because since one month she is suffering from joint pain, she is diabetic patient, which thing can cure/heal for her joint pain?, even she can't walk nicely now :(, when this joint paint will go?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
From the article you linked:
"There is no specific antiviral drug treatment for chikungunya. Treatment is directed primarily at relieving the symptoms, including the joint pain using anti-pyretics, optimal analgesics and fluids. There is no commercial chikungunya vaccine."
- 724 Posts
- 3 Reply Likes
She have no fever now, means virus is not in her body, but she have pain in joints...BTW thanks to reply even you can reply on this type of questions too :) You are really a good man, you should a muslim man. I will pray for her and for you too.
Thanks again
- 724 Posts
- 3 Reply Likes
Can u tell me, what I do to show a dialog box with retry button, if ajax request is failed?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
.
.
.
function(data) { for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
$('#contentTransition').hide();
$('#confirmation').show();
},"json").fail(function() {
alert("Posting Failed, kindly click OK to retry");
What I do here???
},
,
,
Can't I loop it to post method again????
Please Petra tell me detail, plz plz friend????
Thank YOu
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
alert("Posting Failed, kindly click OK to retry");
What should a user do if he doesn't want to try again? The only button is the OK butten.
2. You can loop with a while block, like
var retried = true;
while (retried) {
// your post functionality here
// set 'retried' to false once the post is successful
// use retried=confirm("once more?") on the fail callback function.
}
- 724 Posts
- 3 Reply Likes
As u said that JQM is a single page architecture, What I did in my app, I have created all the pages externally, Now i am thinking to make this one page architecture, Can this make my page loading fast?
Or Multipage and External pages take same time to load data into DOM.?
Which is better?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I thought you already started understanding that months ago...
- 724 Posts
- 3 Reply Likes
I think your duty time has been changed?
- 724 Posts
- 3 Reply Likes
},"json").fail(function() {
var retried=true;
retried=confirm(
'Posting falied'
, function(button) {
if (button == 2) {
//i will handle retry functionality here
}
else if(button ==1)
{
// and I will handle cancel event here
}
}
, 'Posting Failed, press 'Retry' to send your request again or 'Cancel ' to end request.
, 'Cancel,Retry'
);
return false;
});
It's showing box but with OK and cancel button....
2. I used ur steps you told me yesterday,,,,the while loop i think is not good for it. because i saw that 2335 record inserted in my db with same details.... i was shocked........
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If the confirm box only shows OK and Cancel, then the simplest solution would be to ask accordingly.
- 724 Posts
- 3 Reply Likes
Petra, tell me that, if request couldn't reached after n seconds, so how i can create retry functionality, and n nos. of attempt?Please.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I already told you: use a while loop and flag indicating whether or not to retry. That's just a couple of more code lines, which I showed above.
and n nos. of attempt?
Is this the same 'n' as the number of seconds? Or is this a different 'n'?
Just curious: why would you limit the number of retries, if you want the user to be able to retry at all? And what do you want to happen if that number has been reached?
- 724 Posts
- 3 Reply Likes
2. No , this was not same, it was no. of attempts, and yes, there is no need to make retry limited.
Thanks alot.
- 724 Posts
- 3 Reply Likes
:(( and why we are not using any counter........................
- 724 Posts
- 3 Reply Likes
var retried = true;
while (retried) {
// your post functionality here
// set 'retried' to false once the post is successful
// use retried=confirm("once more?") on the fail callback function.
// PETRA what is do here
retried=confirm('Posting falied' , function(button) {
if (button == 2) {
HERE???????????????????? what i do here
}
else if(button ==1)
{
$.mobile.back();
}
}
, 'Posting Failed, press Retry or Cancel'
, 'Cancel,Retry'
);
}
I tried like this, but in that situation data is inserting in db repeatedly, untill page is not closing.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
...which means that the condition for the while loop isn't getting the value 'false'.
Have you checked the value of 'retried' at the start of each iteration? How else did you debug your problem?
Again, you seem to write a bunch of code, test the whole chunk based upon its output, and if the output is not what you expected, you stop your test.
But, in fact, that's the point where you should start debugging. Analayze your code, see where the different branches start under a certain condition and then display the value of the variables in the conditions so you know what exactly is going wrong.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
do {
- ajax-function POST
- success: set retried to false
- fail: set retried to confirm-value
}
while (retried)
- 724 Posts
- 3 Reply Likes
see
Is this correct?
do{
$.post("http://localhost/AmroClean/postcomplaintinfo.php";, {
personname1: personname,
emailphn1: emailphn,
locationtxt1: locationtxt,
complaintlist1: complaintlist,
otherdescription1:otherdescription,
image1: image,
lat1:lat,
lon1:lon,
mycheck1:mycheck
}, function(data) {
retried=false;
for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
$('#contentTransition').hide();
$('#confirmation').show();
},"json").fail(function() {
retried=true;
retried=confirm('Once more?');
});}
while(retried);
}
return false;
});
});
When request is going successful , it's showing returned data, but when going fail it's not confirming again...
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
.
.
.<script>$(document).ready(function() {
$('#contentTransition').hide();
$("#postcomplaint").click(function() {
var personname = $("#personname").val();
var emailphn = $("#emailphn").val();
var locationtxt = $("#locationtxt").val();
var complaintlist = $("#complaintlist").val();
var otherdescription=$("#otherdescription").val();
var image = $('#smallImage').attr('src');
var mycheck=$('#mycheck').val();
var lat=$("#lat").val();
var lon=$("#lon").val();
var retried;
.
.
.
. i think yes.
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Lately, you are posting code snippets, of which none are valid.
In this case, I don't see any closing tags or brackets for the bold parts:
<script>$(document).ready(function() {
$('#contentTransition').hide();
$("#postcomplaint").click(function() {
so no, this code is not correct.
- 724 Posts
- 3 Reply Likes
<script>$(document).ready(function() {
$('#contentTransition').hide();
$("#postcomplaint").click(function() {
var personname = $("#personname").val();
var emailphn = $("#emailphn").val();
var locationtxt = $("#locationtxt").val();
var complaintlist = $("#complaintlist").val();
var otherdescription=$("#otherdescription").val();
var image = $('#smallImage').attr('src');
var mycheck=$('#mycheck').val();
var lat=$("#lat").val();
var lon=$("#lon").val();
var retried;
var mailFormat = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})|([7-9]{1}[0-9]{9})+$/;
if (personname==null || personname=="")
{
$("#nameErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#personname').focus();
});
return false;
}
if (emailphn== null || emailphn=="") {
$("#emailErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
});
return false;
}
if (!mailFormat.test(emailphn)) {
$("#emailformatErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
});
return false;
}
if((locationtxt==null || locationtxt=="") && !$("#mycheck").is(":checked"))
{
$("#locationErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#locationtxt').focus();
});
return false;
}
if(complaintlist==null || complaintlist=="")
{
$("#complaintlistErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#complaintlist').focus();
});
return false;
}
if(($('#complaintlist').val()==11) && (otherdescription==null || otherdescription==""))
{
$("#otherdescriptionErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#otherdescription').focus();
});
return false;
}
else
{
$('#contentTransition').show();
$('#myForm').hide();
$('#postcomplaint').hide();
$('#footer').hide();
// Returns successful data submission message when the entered information is stored in database.
do
{
$.post("http://www.acesabbasi.org/AmroClean/postcomplaintinfo.php";, {
personname1: personname,
emailphn1: emailphn,
locationtxt1: locationtxt,
complaintlist1: complaintlist,
otherdescription1:otherdescription,
image1: image,
lat1:lat,
lon1:lon,
mycheck1:mycheck
}, function(data) {
retried=false;
for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
$('#contentTransition').hide();
$('#confirmation').show();
},"json").fail(function() {
retried=true;
retried=confirm('Once more?');
});}
while(retried);
}
return false;
});
});
</script>
Now tell me please, if this correct or incorrect.Please?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
$.post("http://www.acesabbasi.org/AmroClean/postcomplaintinfo.php";, {
Don't you get a javascript message in your console while testing?
- 724 Posts
- 3 Reply Likes
You also checked before some days ago.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Does the .fail callback get called at all? If so, what is the value of the confirm after clicking 'OK'?
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra, I didn't gave any value to Ok or Cancel button.
If I use this function for button events, then I can handle them with loop?
, function(button) { if (button == 2) {
}
else if(button ==1)
{
}
}
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
The return value of a confirm() can't be nothing. However, if it really is, then something is very wrong in your test device.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
$('#contentTransition').hide();
$("#postcomplaint").click(function() {
var personname = $("#personname").val();
var emailphn = $("#emailphn").val();
var locationtxt = $("#locationtxt").val();
var complaintlist = $("#complaintlist").val();
var otherdescription=$("#otherdescription").val();
var image = $('#smallImage').attr('src');
var mycheck=$('#mycheck').val();
var lat=$("#lat").val();
var lon=$("#lon").val();
var retried;
var mailFormat = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})|([7-9]{1}[0-9]{9})+$/;
if (personname==null || personname=="")
{
$("#nameErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#personname').focus();
});
return false;
}
if (emailphn== null || emailphn=="") {
$("#emailErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
});
return false;
}
if (!mailFormat.test(emailphn)) {
$("#emailformatErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#emailphn').focus();
});
return false;
}
if((locationtxt==null || locationtxt=="") && !$("#mycheck").is(":checked"))
{
$("#locationErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#locationtxt').focus();
});
return false;
}
if(complaintlist==null || complaintlist=="")
{
$("#complaintlistErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#complaintlist').focus();
});
return false;
}
if(($('#complaintlist').val()==11) && (otherdescription==null || otherdescription==""))
{
$("#otherdescriptionErr")
.slideDown("fast",function(){
$(this).delay(3000).slideUp("fast");
$('#otherdescription').focus();
});
return false;
}
else
{
$('#contentTransition').show();
$('#myForm').hide();
$('#postcomplaint').hide();
$('#footer').hide();
// Returns successful data submission message when the entered information is stored in database.
do
{
$.post("http://www.acesbbasi.org/AmroClean/postcomplaintinfo.php";, {
personname1: personname,
emailphn1: emailphn,
locationtxt1: locationtxt,
complaintlist1: complaintlist,
otherdescription1:otherdescription,
image1: image,
lat1:lat,
lon1:lon,
mycheck1:mycheck
}, function(data) {
retried=false;
for(var i = 0; i < data.length; i++){
$("#" + data[i].id).show();
$("#" + data[i].id).html(data[i].message);
}
$('#myForm').hide();
$('#contentTransition').hide();
$('#confirmation').show();
},"json").fail(function() {
retried=true;
retried=confirm('Once more?'
,function(button) {
if (button == 2)
{
Petra what i do here?
}
else if(button ==1)
{
}
}
, 'Posting failed!'
, 'Cancel,Retry');
});}
while(retried);
}
return false;
});
});
</script>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You should check the confirm()'s return value and act upon that.
retried=confirm('Once more?');
should be sufficient to leave the while iteration or stay and loop once more. Why else would you use the 'retried' variable and the 'do...while(retried)' construction?
- 724 Posts
- 3 Reply Likes
I am
Saba Rais
- 724 Posts
- 3 Reply Likes
Why you are not replying.
Petra, Why this variable showing undefined?
function justforcheck() {
var retried;
$.post({
url: '...',
success: function(response) {
retried = true;
}
});
}
alert(retried); // It always ends up being `undefined`.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Hope that you are good.
I know that you will not reply of my non-sense questions.
See i want to create an app for my city.
That is e-wallet.
I want to make my city Cashless.
So, should I start with my city of for whole India?
Here 500 and 1000 notes are banned since 8 Nov. In future we will completely cash less. So I was thinking to create app like this.
Suggest me better thank you Petra.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
How are you going to ensure data security?
This would be way over your head.
- 724 Posts
- 3 Reply Likes
Thanks for your suggestions :)
And your question that how can people pay if they haven't device your app supported.
If we are unable to make whole city cash less doesn't matter , we can make partially initially, Our PM wants to make India digital, so they have many campaigns running to make India digital, also some political parties announced to distribute smart phones to public. So if not now, we can make whole city cash less in future In Shaa Allah.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Please reply.
I want to ask that Can we create user registration-login system without sessions in php, too?
Thanks in advance
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Take Care
- 724 Posts
- 3 Reply Likes
Hope you are good there :)
- 724 Posts
- 3 Reply Likes
- Why PGB is unable to Build android apps now?
- NPM updated their plugin's versions may be, then PGB why can not support them?
- Will it solve in future?
- Or Is there any way to rebuild android apps successfully?
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
I am still getting notifications from Phonegap Build, I hope that you are getting too. I have started to develop my third app now. Yes all credit goes to YOU. Thank You
I CAN NOT forget your favors.
Stay Bless
- 724 Posts
- 3 Reply Likes
I was reading old chat here, and now am laughing on my stupid questions. Really you have taught me alot.
Whenever you live, live happy.
- 724 Posts
- 3 Reply Likes
How are you? hope that u r fit and fine there.
Thanks alot for your help, it is still helping me :)
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers

