I apologize for being a pretty big noob, but I am trying to a utilize window.parent !== window.top if command in order to have all pages loaded from this site within an iframe to load without the footer. I have this javascript within the parent site's header, do I need to be using postmessage for the iframe to read this script? did i do it completely incorrectly? i hope that this can help convey what I am trying to do.
$(document).ready(function() {
var windowURL = window.location.href;
console.log(windowURL);
if (windowURL.indexOf('nofooter') > -1) {
$('#container__footer').css('display', 'none');
}
if (window.parent !== window.top) {
$('#container__footer').css('display', 'none');
}})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<iframe src="different website with windowURL nofooter string" height="1800" width="90%" frameborder="0" scrolling="no"></iframe>