Hi..
I want to open an existing popup and append the content to the pop up.
I have used the following code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function disimage()
{
    var WindowObject = window.open('p1.html', "PrintWindow", "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes");

            WindowObject.document.getElementById("d1").innerHTML="Append TEXT";
            WindowObject.focus();
            WindowObject.print();
            //WindowObject.close();

}

 </script>  

</head>

<body>
<input type="button" onclick="disimage()"/>
</body>
</html>

p1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
Welcome !!!!!!!!
<img src='new_logo.png'>

<div id="d1">
div text
</div>
</body>
</html>

Its not working for me

Recommended Answers

All 2 Replies

And what is your question?

If you want to append more content to the child window (so call pop up), then it is possible but a big mess. Why? Because the idea of creating a separate window for pop up is blockable from browser setting (and most browsers block pop up by default). I would rather use hide/show a div element instead.

Actually I want to do a print page.
In which I want to place a logo(jpg file).
This logo is visible in firefox ,but it is not visible in chrome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.