Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122
  1. function receiveMessage(event) {
  2. var html = event.data;
  3. insertCards(html);
  4. }
  5. function insertCards(html) {
  6. // Remove all previous content
  7. while (document.body.hasChildNodes()) {
  8. document.body.removeChild(document.body.lastChild);
  9. }
  10. // Create a div that holds all the received HTML
  11. var div = document.createElement("div");
  12. div.setAttribute("class", "output-container");
  13. div.id = "output-container";
  14. div.innerHTML = html;
  15. // Add the new div to the document
  16. document.body.appendChild(div);
  17. }
  18. window.addEventListener("message", receiveMessage, false);