Spaces:
Running
Running
Update index.html
Browse files- index.html +6 -0
index.html
CHANGED
|
@@ -13,6 +13,9 @@
|
|
| 13 |
<form>
|
| 14 |
<fieldset name="urlparams">
|
| 15 |
<legend>URL params</legend>
|
|
|
|
|
|
|
|
|
|
| 16 |
<div>
|
| 17 |
<label>Query params <input name="queryparams" type="text" placeholder="?key=value"></label>
|
| 18 |
</div>
|
|
@@ -27,6 +30,8 @@
|
|
| 27 |
|
| 28 |
<script async>
|
| 29 |
const urlparams = document.querySelector('[name="urlparams"]');
|
|
|
|
|
|
|
| 30 |
urlparams.querySelector('button').addEventListener('click', () => {
|
| 31 |
const queryString = urlparams.querySelector('[name="queryparams"]').value;
|
| 32 |
const hash = urlparams.querySelector('[name="hash"]').value;
|
|
@@ -34,6 +39,7 @@
|
|
| 34 |
window.parent.postMessage({ hash, queryString }, '*');
|
| 35 |
}
|
| 36 |
});
|
|
|
|
| 37 |
</script>
|
| 38 |
</body>
|
| 39 |
</html>
|
|
|
|
| 13 |
<form>
|
| 14 |
<fieldset name="urlparams">
|
| 15 |
<legend>URL params</legend>
|
| 16 |
+
<div>
|
| 17 |
+
Iframe src <pre></pre>
|
| 18 |
+
</div>
|
| 19 |
<div>
|
| 20 |
<label>Query params <input name="queryparams" type="text" placeholder="?key=value"></label>
|
| 21 |
</div>
|
|
|
|
| 30 |
|
| 31 |
<script async>
|
| 32 |
const urlparams = document.querySelector('[name="urlparams"]');
|
| 33 |
+
const showIframeSrc = () => urlparams.querySelector('pre').textContent = window.location.href;
|
| 34 |
+
|
| 35 |
urlparams.querySelector('button').addEventListener('click', () => {
|
| 36 |
const queryString = urlparams.querySelector('[name="queryparams"]').value;
|
| 37 |
const hash = urlparams.querySelector('[name="hash"]').value;
|
|
|
|
| 39 |
window.parent.postMessage({ hash, queryString }, '*');
|
| 40 |
}
|
| 41 |
});
|
| 42 |
+
showIframeSrc();
|
| 43 |
</script>
|
| 44 |
</body>
|
| 45 |
</html>
|