Solved

Saving of View Source Content of the Child HTML page window

Posted on 2003-11-19
6
170 Views
Last Modified: 2010-04-17
Respected Sir,

I am facing the problem of saving the view source content as an html page. I have one html file that consists the
"Print" button on clicking the button through the javascript i am creating another window and i am writing the html content(image and text) to newly opened window through javascript document.write() method.

My problem is i wanted to save the content of the newly opened window thorugh the File->SaveAs (web page complete) with text and image so i can carry this page to somewhere for to take the printout, but when i did like that always it is saving the contents of the main window. what could be the reason? how to approach this?

I have pasted the souce,what it looks like

<html>
<head><title>To Save Child Window</title>
<script language="javascript">
function CallPrint(){


      var win = window.open('','','');
      win.document.open();
      var strHTML = '<html><head><title>The Child Window</title></head>';
      strHTML = strHTML + '<body><form name=Frm><img src="../img/abc.gif"><h2>My Photo - Manu</h2></form>';
      strHTML = strHTML + '</body></html>';
      win.document.writeln(strHTML);
      win.document.close();
}
</script>
</head>

<body>
<form name="Frm" id="Frm">
<input type="button" name="Print" value="Print" onclick="CallPrint();">
</form>
</body>
</html>
0
Comment
Question by:manohar_1977
  • 2
6 Comments
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9777636
the reason is that since you are not giving any address the address of the parent is passed. if you right click and view the source it shows the parent file name and the save as can only reterive content from the web and show.
0
 

Author Comment

by:manohar_1977
ID: 9778724
I accept the reason to some extent, but i asked how to approach it, unless and until i know how to approach(i.e, giving the address to the window and saving the address of the window which i wanted) i can't justify, that is why i pasted the piece of the code.
0
 
LVL 9

Accepted Solution

by:
bhagyesht earned 125 total points
ID: 9808628
instead of using client side generation of the window user server side generation of the window. if you want for a free hosting brinkster.com has free asp hosting.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hasOne  challenge 59 92
How to get boolean result of md5sum from two files in powershell 8 67
Hide vba in gp 7 49
Birthdays 3 22
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now