暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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);