I'm building a simple app that takes an Email address and gets JSON information back related to that Email via REST Service. Names, Jobtitle, Social Media Profiles, Location etc.
According to the tests on my iOS devices, the responses are mapped correctly to the fields. It may happen though, that the person is not signed-up for all queried social media networks, thus resulting in an empty string for that field (I had it returned null previously, with the same result).
Since the links have to have a default href in the UI designer, I let them have http://appery.io.
After entering an email address and invoking the rest service with the click of the search button, the fields get populated by the json response. Now I want to only display valid links; links that have not an empty string as its href or http://appery.io as its href. And here I run into problems, because even though the href appears to be what it's been set to by invoking the rest service, no links will show, when I run this javascript after invoking the service.
if ($('#facebook_link').attr('href') != 'http://appery.io') {
$('#facebook_link').show();
}
if ($('#twitter_link').attr('href') != 'http://appery.io') {
$('#twitter_link').show();
}
if ($('#linkedin_link').attr('href') != 'http://appery.io') {
$('#linkedin_link').show();
}
if ($('#google_link').attr('href') != 'http://appery.io') {
$('#google_link').show();
}