loading-resources-in-posted-task.js (895B)
1 function load_resources() { 2 //Fetching the Stylesheet 3 var link = document.createElement("link"); 4 link.rel = "stylesheet"; 5 link.href = "resources/empty_style.css?no_cache"; 6 link.id = "link_id"; 7 document.head.appendChild(link); 8 9 // Fetching an image 10 var img = document.createElement("img"); 11 img.src = "/images/blue.png?no_cache"; 12 img.alt = "Sample Image for testing initiator Attribute"; 13 img.id = "img_id" 14 document.body.appendChild(img); 15 16 // Inserting a script element 17 var script = document.createElement("script"); 18 script.src = "resources/empty.js?no_cache"; 19 script.id = "script_id" 20 document.body.appendChild(script); 21 22 //Inserting a html document in an iframe 23 var iframe = document.createElement("iframe"); 24 iframe.src = "resources/green.html?no_cache"; 25 iframe.id = "iframe_id"; 26 document.body.appendChild(iframe); 27 } 28 29 scheduler.postTask(load_resources);