Print() One Frame From Another
Jul 20, 2005
I have 2 frames. The top one is the control frame and the bottom one is
the display. I have a roll-over button in the top frame that I want to use
to do a print() for the bottom frame.
I tried having this JavaScript code when the roll-over button is clicked:
parent.frames[1].focus();parent.frames[1].print()
I am using Internet Explorer on Windows, and I am getting a print window
with "Only the selected frame" selected. But when I click the "OK" button
to tell Windows to print, it prints the top frame instead of the bottom
one...
I also tried putting this function in the header of the bottom frame, and
then calling it from the top frame:
function FramePrint()
{
self.print()
}
But it still likes to print the top frame.
View 4 Replies
ADVERTISEMENT
Sep 8, 2010
I have a frameset with two frames; topFrame and mainFrame. I have code in topFrame and wish to print the contents of mainFrame. The code that I have used has worked for many years and still works on my localhost Apache Server. However, it has now "stopped" working. When I press the button in topFrame it prints the contents of topFrame The code that I am using is
Code:
window.parent.mainFrame.focus()
window.print
I have tried to replace the first line with..
[Code]...
View 1 Replies
View Related
Aug 11, 2005
I tried the print method provided by javascript to print the frame in
current focus. Only the visible content is printed, any hidden content
in the current frame[say, on a different resolution or where the
browser introduces a scroll-bar] does not appear in the printout.
View 1 Replies
View Related
Aug 4, 2009
I currently using the <object> tag to display a webpage in another webpage... essentially. I read that <iframe> is basically deprecated and <object> should be used to replace it.
Thus my code breaks down basically to this: <object data="mywebpage.php"></object>
I'm using FF3 and the question I have is how do I print the contents of the object only? Currently, I have to right click the object and under "This Frame" click Print.
How can I use a print button to resolve this?
View 2 Replies
View Related
Jul 3, 2007
I would like to print a Web page with javascript method window.print() without pages number and footer.
View 7 Replies
View Related
Aug 30, 2011
Can I configure this function to make it print a certain pixel only?
Around 500px X 700px Center.
CODE:
Is it possible?
View 1 Replies
View Related
Apr 7, 2006
I'm trying to create a print link that sends the page to the printer without opening the print dialog box on the browser.
I know that window.print() will open the print dialog and then the user has to click OK.
is there anything that can do this?
View 1 Replies
View Related
Jul 21, 2009
I'm facing a different problem.
I'm having a long page where there will be content to be printed.
I'm using the css using media=print to hide all the unwanted contents and using the window.print method to invoke printing.
But when i click the print button it prints only partial content upto a single page and all the remaining contents are discarded.
I wonder what may be the problem!!!
And there's another problem , i've bills to be printed in order but dont want them to be breaking in between pages .(ie a bill should be printed fully if there is enough space at the bottom or should be printed on the next page)
How can i do both of this?
View 3 Replies
View Related
Jan 3, 2002
Hey all. I am currently putting together a test page of mine where a popup window comes up showing a coupon that I will have a link enabling them to print it simply and easily.
For my current code I have a simple <a href="javascript:window.print()"> that works great on both Internet Explorer 5 and Netscape 4/6 on the PC but for some reason, Internet Explorer 5 for Macintosh doesn't do a thing.
View 2 Replies
View Related
Aug 26, 2011
I have a domain: example.com; which is the parent.And a subdomain: api.example.com; which page 'receiver.html' is being loaded in an iframe, child of parent. Both pages set document.domain = example.com.
I'm trying to adapt this code:[url] but Idon't want to load jQuery from the <iframe> again but I need to have the method $.ajax() working from the <iframe> otherwise it would be a cross-domain request and the browser would abort it. I tried ingenuously to set via $('iframe')[0].contentWindow.$.ajax = $.ajax() and I just got a shortcut to the parent page jQuery method. I also tried to "clone" it using $.expand (true...) but the method doesn't work for me; probably because of the complexity of the objected I'm trying to clone. So is there a way for me to use jQuery to have only a $.ajax() method in the <iframe> ? I've thought even about creating a XHR in the child-iframe and then use that in the $.ajaxSetup ({xhr: THATNEWXHR}) but I couldn't do it. I mean, I want to use the XHR factory from jQuery (which has fallbacks for IE, etc) but it has to be created from the iframe-child.
Maybe there is other way to make the AJAX call come from the child-iframe.
If you're wondering "why don't you load jQuery from <script> in the child-iframe", there is a reason... As I'm using jQuery plugins + my own custom javascripts + other independent scripts I created a compiler which minifies each file and bundle them in one. The advantage of this is the reduction of HTTP requests. So "why don't you load that bundle inside the child-iframe?", because it's ugly and Twitter doesn't... Yeah, I like to take Twitter as a reference and I think if they were able to make it so can I;
I got to work in most browsers except IE and Operaby doing it with pure javascript.
I'm "attaching" the code for you guys to test. If you open it with Chrome, Safari or Firefox you will receive 2 alerts one with the return of $.get() and another with the return of a request made via XMLHttpsRequest object. Otherwise (if you open it with IE or Opera) you'll get 'undefined' in the first alert but the real return in the second.
This is the example.com/index.htm:
View 4 Replies
View Related
Jul 20, 2005
Is it possible to do an ie print from javascript that does not bring
up the print dialog? I'm in a situation where i need to load a
sequence of files into a browser and print all of them without any
user interaction.
View 3 Replies
View Related
May 1, 2009
Is there a way to get a print preview triggered by a button rather than just print?
<input type="button" name="print" value="Print" onClick="document.print();">
Unfortunately, the WebBrowser.execWB(7) functionality doesn't work in FF3.
Any idea using good old fashion JavaScript or jQuery?
View 1 Replies
View Related
Jun 22, 2007
So I have a print page that's written in a combination of php & html. The body tag is outside the php with an onload="window.print();window.close;"
The idea behind this print page is when the print button is pressed on the parent window, it generates this child window that is specifically made larger for printing reports that people can read easily. I use css for text styles and the table "width" is longer.
All the html code inbetween the body tags is created by php using the php "Print" function.
</head>
<body class="page" onload="window.print();window.close;">
<?php
Print "<table width=1600 border=1 cellpadding=0 cellspacing=0 class=page>";
Print "<tr bgcolor=cbe5ff>";
Print "<td width=30>WO #</td>";
// yada yada yada
?>
My problem is it does not print the table dimension or the font size above a certain size. When I print in landscape, which is what this page is designed for, it prints the same size as "scaled to fit" portrait. On the screen the size is correct and if I use the browser print button, it prints to the correct size.
The css works, it will make changes and will even make the text smaller just won't print over a certain size (9pt?).
View 1 Replies
View Related
Jun 27, 2007
I have a requirement to print particular area of a web page. Web page has many div's and one iframe in it. I need to print a div and iframe content with one single print command. I am able to do so but then two print dialog boxes come up when the print command is given. I have written a javascript function to achieve this.
I did find a solution to this but then I do not understand why onload fails to work in this scenario. I am summarizing steps I had followed.
1) Read the contents of div using innerHTML and store it to a variable.
2) Read the contents of iframe and store it to a variable. "Details" is id of the iframe.
var iframeObj = document.getElementById("Details");
var iframeDoc;
frameDoc = iframeObj.contentWindow.document;
3) Open a window and write all these content after writing these few lines
flashDivWindow.document.write('<html><head><title>Print page</title></head><body onload="javascript:window.print()">');
When I view the source all HTML code can be seen as expected, however this doesn't trigger onload event. I need to refresh the page for print to happen, some thing which isn't practical. Using Javascript reload doesn't help as print is invoked even before the page content is reloaded.
View 2 Replies
View Related
Oct 15, 2001
Im trying to make a back button that reloads the previous page the user was at.
The back button will be on a small top frame and the page that needs to be controlled will be in the main frame.
The top frame is just a navigation system, and all pages will be loaded in the main frame.
Im trying to use this Code:
<FORM>
<INPUT TYPE="button"
NAME="back"
VALUE="BACK"
onClick="history.go(-1)">
</FORM>
Does anyone know how I could accoplish the desired result using this code, or any other code? And what about a foreward button?
View 2 Replies
View Related
Jul 20, 2010
I want to have a main image in place and when you click on 1 of the 3 frame options the frame changes showing a preview. Also I would like the add to cart button change its code to add the correct item as well.
View 2 Replies
View Related
Aug 30, 2010
i need to pass the data in the textfields from the left frame to the textfields in the right frame of my frameset. (ex: dslnum of frame1 will be pass to txtDSLTN of frame2)[URL]
View 19 Replies
View Related
May 22, 2011
I have two frames (frameset, let's call it frame1 and frame2). Frame1 has links..., and frame2. When some link in frame1 is clicked, it must be changed content of the frame2. Here's example: click. How to do that? (I don't see any javascript code)
View 2 Replies
View Related
Jul 19, 2006
I have a parent document that has a frameset with two frames in it. The first frame is a "header" that runs across the top of the site, and never changes. The second frame contains the "content" of the site. Essentially, I am trying to figure out how to prevent the header appearing above external sites when the user clicks an external link in the "content" frame.
Every time the content frame changes to a new URL, I would like the check that URL and determine if the content frame is changing to an external URL (i.e. different domain in URL) or to an internal link (same domain in URL). If the content is changing to an external link, I want to break out of the frame and just load that external link in the top most document.
I would like all of my javascript to be in the parent document, not spread throughout the individual pages of the site. I was trying to approach this by setting the onunload event handler of the content frame, but I am left with a couple of specific questions:
1. In handling an unload event, can you determine the next URL that the document is loading? Code:
View 6 Replies
View Related
Jan 10, 2011
I have a little problem, I structure my site with a main page index.html with a frame in the central whit name CENTRALE, so every other page I will open within this frame. Now I need to have a direct link to these internal pages, give an example I wish it were possible to go to the page clothing giving a direct link to that section of the site type www.indirizzo.com / clothing.html because the state of things if I take the 'direct address to that page I open only the part inside of the frame, but I wish I would open inside the "main frame, there is a solution in javascrip to overcome this problem?
View 4 Replies
View Related
Feb 15, 2009
I want have two iframes in a single php page and I print them using two print methods. May I know how to print the both iframes using a single print method?
View 6 Replies
View Related
May 13, 2009
I use dreamweaver mx html editor to make web sites. I think I know enough Html to get by. My new site uses a frame set so the head and controller don't change reload or move. This works nice, now all I have to do to make a new page is make the content page. But my problem is if I send out a link for someone to look at, it only loads the content page and not the frame set. I thought I could use javascript to determine if the frame set is present and if not load it. But I can't seem to find a way to sent variables from one frame to another. Also if a user clicks a link I would like my flash controller to reflect it.
[Code]...
View 1 Replies
View Related
Aug 9, 2004
I need to know how to refresh a bottom frame TO a specific dynamic URL from my top frame (meaning the code has to be in the top frame) say every 5 seconds. The top frame will be a php file as I need DB values. But I believe the frame thing is done via javascript. This ain't working so far, it only loads the first URL at not the rest. Is there the ability to refresh to a specific url in a target frame. Code:
View 5 Replies
View Related
Feb 19, 2009
One more question about manipulating iframes. In a script I've looked through to investigate AJAX file uploads, there is this technique for accessing the contents of an iframe:
Code:
if(frame.contentWindow)
{
var thebody = frame.contentWindow.document.body;
}else if(frame.contentDocument)
{
var thebody = frame.contentDocument.document.body;
}
I haven't been able to find much info on contentWindow and contentDocument. In fact, other sources I've found talk only about using contentWindow to access an iframe's contents, ignoring contentDocument completely. What is the difference between the two, and what browsers is the contentDocument check targeting? Any modern browsers, or is this a backward compatibility thing?
View 8 Replies
View Related
Jul 23, 2005
Is it possible to print [using window.print()] a page that has no "title"
and "page number" on the top and no "link adress" and "date" on the bottom
(to print just a page just as it is...)?
View 2 Replies
View Related
Jul 23, 2005
If I do the following, it will pop up print dialog. But i want to produce
"File->Print Preview" Screen. Is it possible to do that?
<input type="button" value='Print Preview' onClick='window.print();'>
View 1 Replies
View Related