Web hosting unlimited bandwidth - 70 CHAPTER 3 CONTENT CHUNKING PATTERN Document

70 CHAPTER 3 CONTENT CHUNKING PATTERN
The img tag is used to reference an image. The img tag is in most cases defined by using a src attribute that references an image location. In the example, the srcattribute does not exist, and instead an id attribute exists. When the HTML page is downloaded and presented, a broken image is displayed because there is no image associated with the img tag. To make the img tag present an image, the Get Image button is clicked to make a request to retrieve the single-line file containing the URL of the image. When the XMLHttpRequest has downloaded the single-line file, the function implementation for complete is called and the attribute/property src is assigned to the URL of the remote image. Thus the browser updates itself, loading the image and displaying it. The single-line file is stored at the URL /chap03/chunkimage01.html, and its content is defined as follows: /static/patches01.jpg When the previously outlined HTML page with an undefined src attribute is loaded, Figure 3-10 is generated. Figure 3-10 shows a small box below the Get Image button that indicates a broken imgtag, because there is no loaded image. When the Get Image button is clicked, the link of the image is downloaded and assigned to the img tag, which causes the image to be loaded. Figure 3-11 is the regenerated HTML page.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Leave a Reply