John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

my project is also public at:

http://appery.io/app/mobile-frame?src...

OR I also you guys can access my project since i shared it. To get to the page:

Driver Login My Profile:

an input of '248-222-5555' will return a '1' and any other digits/characters will return always exactly '-1'

when a '-1' is returned, the next popup should be 'profile_not_saved'

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Previous Successful JS Code worked, now no more to change popup on success of service request

Try to change code to next one:
code
if(data == -1 ) {
$.mobile.changePage("profile_not_saved.html", {transition: "pop"});
}
else {
$.mobile.changePage("profile_saved.html", {transition: "pop"});
}
/code

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

hi, now going back to the original style code I started with that worked fine for a string response ( a 'true' or 'false') :

if(data.response==="true") {
$.mobile.changePage("status_updated.html", {transition: "pop"});
}
else {
$.mobile.changePage("status_not_updated.html", {transition: "pop"});
}

this code a couple weeks ago worked, now it doesn't work. Is there something that changed thats works with Appery? If so, what is the correct line of code now?

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

Previous Successful JS Code worked, now no more to change popup on success of service request

Hello! We didn't change anything. Do you have any errors in Console when you run this code?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

it keeps going to the else line and doesnt see the 1st line and filter the result based on 'true' or not...

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

now I went back to my original service i started with back a few weeks ago. It worked with the 'submit_load2' service with this exact code:

if(data.response==="true") {
$.mobile.changePage("load_submitted.html", {transition: "pop"});
}
else {
$.mobile.changePage("load_not_submitted.html", {transition: "pop"});
}

I just tested this service now and this has some issues as well. With this service, it has the opposite effect as the previous one. Instead of going to the 'true' line, it always goes to the 'else...' line no matter what the response is. So, we have two identical services with the same responses using the same exact JS, but getting two opposite results. This is strange...

Any ideas how to fix these services?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

i shared my Truck Project with you guys just in case you would like to check it out or go to the public test:

http://appery.io/app/mobile-frame?src...

for service 'UpdateStatus2' go to:
1 - Driver Login My Profile:
1a - type in 'xx', and hit 'Save'
1b - hit 'OK' (this will leave the driver_id' = '-1' (which should make an error in the next stage)
2 - Driver Login Update Status:
2a - Hit 'Update Status' at the bottom of the page: If the JS Code works in this case you should see the error popup: 'status_not_updated', but it keeps going to the 'status_updated' popup

for service 'submit_load2' go to:
1 - Dispatch Login Login Assign a New Load:
1a - go to the bottom of the page and hit 'Submit Load': If the JS code works in this case you should see the Submitted popup: 'load_submitted', but it keeps going to the error popup: 'load_not_submitted'
--

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

Previous Successful JS Code worked, now no more to change popup on success of service request

and of course I tested both of these services work fine in the raw tests - just in case you were wondering

Return to “Issues”