(I am using content.document since the code is being run from a FireFox sidebar plugin)
iElement = content.document.createEle
iElement.src = "source";
iElement.style.position = "absolute";
iElement.style.left = 50;
iElement.style.top = 50;
iElement.style.zIndex = 100;
This code works perfectly on webpages without DTD,
(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd
But when used on webpages with DTD (either strict or loose), the image always gets placed at the bottom left corner of the page, regardless of the position specified.
Also, when I pefix the DDT with <HTML>. the code works.
Please let me know if there is a foolproof way of placing an image on an existing webpage at a specific position, regardless of DTD being used or not.
No DTD (Works): http://xpst.vrac.iastate.edu/WebxPST/NoDTD.html
Loose DTD (Doesn't work): http://xpst.vrac.iastate.edu/WebxPST/LooseDTD.html
Strict DTD (Doesn't work): http://xpst.vrac.iastate.edu/WebxPST/StrictDTD.html
Prefix DTD with <HTML> (Works): http://xpst.vrac.iastate.edu/WebxPST/PrefixDTD.html