?
Solved

Saving of View Source Content of the Child HTML page window

Posted on 2003-11-19
6
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

719 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