script tags get removed from content
-
Hi, this plug in is really nice, easy to use, doesn’t force me to use Gutenburg.
The problem I’m having is that the content I’m trying to put inside the accordian is an iframe followed by some javascript.
I’m putting the content in while in Text mode, but every time I save the accordian the script tags get removed. When I edit the accordian to look at the content it is always in Visual mode and the script tags are gone.
I’ve also noticed the id gets removed from the iframe.
Here is the code placed inside the accordian
<iframe id="jlpsummer-form-iframe" class="jlpsummer-form-iframe-28181" src="https://widgets.courtreserve.com/Online/Public/EmbedCode/11387/28181"style="margin:0; width:100%; border:none; overflow:hidden;" scrolling="no" ></iframe> <script type="text/javascript"> var myEventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; var myEventListener = window[myEventMethod]; var myEventMessage = myEventMethod == "attachEvent" ? "onmessage" : "message"; myEventListener(myEventMessage, function(e) { switch (e.data.action) { case "setHeight": { var embedCodeId = e.data.embedCodeId; if (embedCodeId != null && embedCodeId != '') { var elements = document.getElementsByClassName('
jlpsummer-
form-iframe-' + embedCodeId); for (var i = 0; i < elements.length; i++) { elements[i].style.height = (e.data.height) + "px"; } } else { document.getElementById('jlpsummer-
form-iframe').height = (e.data.height) + "px"; } break; } } }, false); </script>However it ends up like this
<iframe class="jlpsummer-form-iframe-28181" src="https://widgets.courtreserve.com/Online/Public/EmbedCode/11387/28181"style="margin:0; width:100%; border:none; overflow:hidden;" scrolling="no" ></iframe> var myEventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; var myEventListener = window[myEventMethod]; var myEventMessage = myEventMethod == "attachEvent" ? "onmessage" : "message"; myEventListener(myEventMessage, function(e) { switch (e.data.action) { case "setHeight": { var embedCodeId = e.data.embedCodeId; if (embedCodeId != null && embedCodeId != '') { var elements = document.getElementsByClassName('
jlpsummer-
form-iframe-' + embedCodeId); for (var i = 0; i < elements.length; i++) { elements[i].style.height = (e.data.height) + "px"; } } else { document.getElementById('jlpsummer-
form-iframe').height = (e.data.height) + "px"; } break; } } }, false);Thank you.
- This topic was modified 9 months, 3 weeks ago by .
- This topic was modified 9 months, 3 weeks ago by .
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘script tags get removed from content’ is closed to new replies.