Recording embedded documents that can't be recognized by the HTML parser


Preloading an image using scripts

If caching is enabled, embedded documents may be downloaded in advance. In this case, only two request will be sent to the server. Therefore, we needn't/can't record those additional request for download in the script block.

<script language="JavaScript">
    pic1 = new Image();
    pic1.src = "../box1.gif";
    pic2 = new Image();
    pic2.src= "box2.gif";

</script>

 

<img src="box1.gif">
<img src= "box2.gif">

Box1.gif
Box2.gif

 


Simple download using scripts

The downloads of 'box3.gif' and 'box4.gif' have to be recorded with WebPageAddUrl(...). The 'img' tags will be managed by the HTML parser.

<script language="JavaScript">
  pic3 = new Image()
  pic3.src = "box3.gif"
  pic4 = new Image()
  pic4.src = "box4.gif"

</script>

<img src="../images/corporate_pic.gif" alt="corporate_pic.gif">
<img src="../images/dept_pic.gif" alt="dept_pic.gif">

 

corporate_pic.gif dept_pic.gif