Difference between revisions of "Widget:High-Elf-Swordsman"
From Rivendom
| Line 1: | Line 1: | ||
| − | <iframe id=" | + | <iframe id="monsterFrame" name="monsterFrame" src="<!--{$url}-->" style="display:none;"></iframe> |
<script> | <script> | ||
| Line 6: | Line 6: | ||
} | } | ||
| − | + | <!-- $('#monsterframe').on("load", function () { | |
var frameContents = $('#monsterframe').contents(); | var frameContents = $('#monsterframe').contents(); | ||
var statBlockContent = frameContents.find('stat-block'); | var statBlockContent = frameContents.find('stat-block'); | ||
| Line 12: | Line 12: | ||
document.getElementById('mw-content-text').innerHTML += $('#monsterframe').contents().innerHTML; | document.getElementById('mw-content-text').innerHTML += $('#monsterframe').contents().innerHTML; | ||
document.getElementById('mw-content-text').appendChild(statBlockContent); | document.getElementById('mw-content-text').appendChild(statBlockContent); | ||
| − | }); | + | });--> |
| + | |||
| + | var iFrameWindow = frames['monsterFrame']; | ||
| + | var iFrameDocument = iFrameWindow.document; | ||
| + | var iFrameContents = iFrameDocument.getElementsByTagName('stat-block'); | ||
| + | |||
| + | document.getElementById('mw-content-text').appendChild(iFrameContents); | ||
</script> | </script> | ||
Revision as of 02:08, 21 August 2015
<iframe id="monsterFrame" name="monsterFrame" src="" style="display:none;"></iframe> <script>
function getStatBlockContent(document){
}
var iFrameWindow = frames['monsterFrame'];
var iFrameDocument = iFrameWindow.document;
var iFrameContents = iFrameDocument.getElementsByTagName('stat-block');
document.getElementById('mw-content-text').appendChild(iFrameContents);
</script>