I have a function that gets an image along with it's height and width. I open the image in a new window using window.open I defined an onclick
so that if anyplace on the image is clicked the window closes, this works fine. I have defined a button and located it outside the image in the new window. When that button is clicked it calls another function, this does not work. Is there away to make this work?
I have tried several different ways of making this work. I have tried removing the close when clicking on the image and that did not work. I have tried putting the button on the image and that did not work.
function showImg(imgSrc, H, W) {
newImg = window.open("", "", config = "height=" + H + ",width=" + W + "");
newImg.document.write("<img src='" + imgSrc + "' height='" + H + "' width='" + W + "'class=photoPreview onclick='window.close()' style='position:absolute;left:0;top:0'>");
newImg.document.write('<input type="button" id="btn_makedefault" onclick=saveMe(); style="color: black; position: absolute; left: 0; bottom: 0";title="Save Image"; value="Save"></button>');
newImg.document.close();
newImg.focus();
}
I want the Save button to remain at the bottom of the window and when clicked to call the other function saveMe().