javascript - Change the same content of two iframes between two web pages with a click -


I need to change the same content of two iframes between two web pages with a click like a powerpoint, Where you need to convert it to a new slide on two screens with just one click.

I hope you can answer me! Thanks!

If you are familiar with changing the content of an iframe, then it is quite simple to do multiple Iframes If you are certain that you will not need to replace more than two iframes, the simplest solution is to do something like this with javascript:

  // function which is an IFRAME function update Updates iframe (iframe) {var iframeDocument = iframe.contentWindow.document; // iframeDocument is the document of iframe, so the commands / commands / such as will work below. // iframeDocument.appendChild (); // iframeDocument.body.innerHTML = "& lt; h1> Hello World "; } // Get the getElementById ('iframe1') from the DOM to your html id feature var iframe1 = iframes1 = document. Var iframe2 = document.getElementById ('iframe2'); // One click event listener should be tied to the document body and run the updateIframe on both the iframes document.body.addEventListener ('click', function () {updateIframe (iframe1); updateIframe (iframe2);});  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -