2019-11-18 18:18:28 -08:00
|
|
|
<script>
|
2020-04-06 15:09:43 -07:00
|
|
|
function goLocal() {
|
|
|
|
document.querySelector('iframe').src = location.href.replace('dynamic-oopif.html', 'grid.html');
|
|
|
|
}
|
|
|
|
|
|
|
|
function goRemote(iframe) {
|
|
|
|
iframe = iframe || document.querySelector('iframe');
|
2019-11-18 18:18:28 -08:00
|
|
|
const url = new URL(location.href);
|
|
|
|
url.hostname = url.hostname === 'localhost' ? '127.0.0.1' : 'localhost';
|
|
|
|
url.pathname = '/grid.html';
|
|
|
|
iframe.src = url.toString();
|
2020-04-06 15:09:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const iframe = document.createElement('iframe');
|
|
|
|
goRemote(iframe);
|
2019-11-18 18:18:28 -08:00
|
|
|
document.body.appendChild(iframe);
|
|
|
|
}, false);
|
|
|
|
</script>
|