< >

iframe-einbinden.php


Quell Code


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!--
<iframe id="iFrame" srcdoc="<h2>Ein Moment bitte...</h2>"src=""></iframe>
-->
<div id="rein" style="width:100vw;height:auto"></div>
<script>
 var sammeln='';
  var  url ="https://www.weatherlink.com/embeddablePage/show/893f82f3a53e45d0b50f125bdb1cb31d/wide";
 var url='https://www.weatherlink.com/embeddablePage/getData/893f82f3a53e45d0b50f125bdb1cb31d?_=1573413338685';
(function() {
    var cors_api_host = 'cors-anywhere.herokuapp.com';
    var cors_api_url = 'https://' + cors_api_host + '/';
    var slice = [].slice;
    var origin = window.location.protocol + '//' + window.location.host;
    var open = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function() {
        var args = slice.call(arguments);
        var targetOrigin = /^https?:\/\/([^\/]+)/i.exec(args[1]);
        if (targetOrigin && targetOrigin[0].toLowerCase() !== origin &&
            targetOrigin[1] !== cors_api_host) {
            args[1] = cors_api_url + args[1];
        }
        return open.apply(this, args);
    };

    $.ajax({
  url: url,
  cache: false
})
  .done(function(html) {
  console.log(html)
  
  for (const keyValuePair of Object.entries(html)) {
 sammeln+=keyValuePair[0]+' = '+keyValuePair[1]+'<br>';
}
  
$('#rein').html(sammeln);
 // html=html.querySelectorAll('script');
  //html=html.replace(/src="\/js/g,'src="https://www.weatherlink.com/js');
  //html=html.replace(/href="\/css/g,'href="https://www.weatherlink.com/css');
 // html=html.replace(/href="\/static/g,'href="https://www.weatherlink.com/static');
 // htm=html.split('container-fluid')[1].split('</div></div>')[0];
  
   // $( "#iFrame" ).attr('srcdoc',html.outerHTML);
       //$( "#iFrame" ).attr('src',url); 
  });
    
    
})();
    
    

</script>