Page 1 of 1

Service in javascript

Posted: Tue May 07, 2013 6:33 pm
by Gert Vanwijn

Hi,
this javascript doesn't do what I want it to do and I can't find what's wrong.

var receiver = Appery('receiver').val();
var subject = Appery('Subject').val();
var location = Appery('location').val();

if(receiver == '' subject == '' location == ''){
Appery('required').show();
if(receiver == ''){
Appery('receiver').parent().css('border','2px solid #ff0000');
}
if(subject == ''){
Appery('Subject').parent().css('border','2px solid #ff0000');
}
if(location == ''){
Appery('location').parent().css('border','2px solid #ff0000');
}
}
else{
Appery('required').hide();
restservice1.execute({});
Appery.navigateTo('Details2');
}

It does everything correct, except running 'restservice1' isn't executed !
Any solutions ?


Service in javascript

Posted: Tue May 07, 2013 6:49 pm
by maxkatz

Please check the following:

Network tab - to make sure the request is sent or not
Console - for any JavaScript errors


Service in javascript

Posted: Wed May 08, 2013 12:36 pm
by Gert Vanwijn

No, the request isn't send.
Everything is executed correctly, except restservice1, which doesn't get executed


Service in javascript

Posted: Wed May 08, 2013 12:36 pm
by Gert Vanwijn

No, the request isn't send.
Everything is executed correctly, except restservice1, which doesn't get executed


Service in javascript

Posted: Wed May 08, 2013 1:00 pm
by Oleg Danchenkov

How do you know that restservice1 does not execute correctly? Try to add alerts on service Success and Error events.


Service in javascript

Posted: Wed May 08, 2013 1:15 pm
by Gert Vanwijn

Because it doesn't show up in the network tab


Service in javascript

Posted: Wed May 08, 2013 1:40 pm
by Oleg Danchenkov

Could you share your project with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


Service in javascript

Posted: Fri May 10, 2013 12:06 pm
by Gert Vanwijn

Solved it. The page was loaded on completion of another event too. Sorry for the bother