<!-- Script zum dynamischen einbinden des API Frames -->
var domain = 'https://blenda.online-stellenmarkt.net/vam-api.php';
var form = '?doc=vam-api-formular&id=';
var sel_id = 0;
img_ok = '<img src="styles/vam-api-style/images/ba_no.png" title="Job für Die Bundesagentur für Arbeit optimieren" width="25"></a>';
img_no = '<img src="styles/vam-api-style/images/ba_act.png" title="Job wurde an die Bundesagentur für Arbeit übertragen" width="25"></a>';
img_er = '<img src="styles/vam-api-style/images/ba_fehler.png" title="Fehler beim Senden an die Bundesagentur" width="25"></a>';
function popup ( obj ) {
sel_id = obj.dataset.id;
obj.id = obj.dataset.id + 'button';
target = domain + form + sel_id;
title = 'Job ( '+ sel_id +' ) an die BA senden';
iframe = '<iframe src="'+target+'" width="100%" height="100%" style="height:100%; border:none; margin:0px" />';
document.getElementById('popup-title').innerHTML = title;
document.getElementById('popup-body').innerHTML = iframe;
jQuery("#popup").modal();
}
<!-- Tauscht Button aus -->
jQuery( document ).ready(function() {
jQuery('#popup').on('hidden.bs.modal', function () {
obj = document.getElementById ( sel_id + 'button' );
sync = Math.round ( 100000 * ( Math.random ( ) ) ) + 10000;
jQuery.get( domain + '?doc=vam-api-ajax&id=' + sel_id + '&sync=' + sync, function ( data ) {
data = data.trim();
obj.innerHTML = img_no;
if ( data == 'ok' ) obj.innerHTML = img_ok;
if ( data == 'er' ) obj.innerHTML = img_er;
});
});
});