0

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

2
Contributors
2
Replies
15
Views
3 Years
Discussion Span
Last Post by divyakrishnan
0

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.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.