Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Service in javascript

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 ?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Service in javascript

Please check the following:

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

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Service in javascript

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

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Service in javascript

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

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Service in javascript

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

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Service in javascript

Because it doesn't show up in the network tab

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Service in javascript

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

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Service in javascript

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

Return to “Issues”