476 Part III . Document Objects Reference Syntax Accessing BASE element object properties or methods: (IE4+) [window.]document.all.elemID.property | method([parameters]) (IE5+/NN6) [window.]document.getElementById( elemID ).property | method([parameters]) About this object The BASE element enables the page author to specify a default server directory and/or link target for the entire page. If you omit the BASE element from the HTML, browsers use the current page s path as the base URL and the current window or frame as the default target. Occasionally, a page generated entirely by way of document.write() has difficulty establishing the same BASE URL as the docu ment that generates the content, particularly if the primary page is written out by a server script (in Perl or in another language). Including a tag in the dynamically written new page solves the problem; the new page can fetch images or other external elements via relative URLs within the page. The two distinctive properties of the BASE element object are rarely scripted, if ever. Properties href Value: URL String Read/Write NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . The href property is generally an absolute URL to the directory you wish to declare as the default directory for the page. Even though browsers automatically set the BASE HREF to the document s own directory, this object and property do not have any values unless you explicitly set them in a tag. In IE, changing this property after a page loads causes the page to re-resolve all relative URLs on the page to the new BASE HREF. Therefore, if images have relative URLs assigned to their src properties (either by way of the tag attribute or script), a change to the BASE element s hrefproperty forces the browser to look for those same relative URLs in the new directory. If the files aren t there, then the images show up broken on the page. On the CD-ROM Example on the CD-ROM BASE.href
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.
This entry was posted
on Wednesday, August 1st, 2007 at 9:08 am and is filed under JBOSS.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.