Spotter-VM/basic/srv/portal/js/script.js

18 lines
681 B
JavaScript
Raw Normal View History

$(function() {
$.getJSON('js/apps.json', function(data) {
$('div.c').each(function() {
var div = $(this);
var id = div.attr('id');
if (data.hasOwnProperty(id)) {
if (data[id].hasOwnProperty('url'))
div.find('h2 a').attr('href', data[id].url.replace('{host}', window.location.hostname));
if (data[id].hasOwnProperty('login'))
div.find('.login').text(data[id].login);
if (data[id].hasOwnProperty('password'))
div.find('.password').text(data[id].password);
} else
div.hide();
});
});
});