film Posted January 26, 2007 Posted January 26, 2007 Hi, well basicly i want to print a frame of my website using a .gif which is located in a differant frame and when clicked on will print the main frame. I have got : <IMG src="Print.gif" onclick="top.mainframe.print()"> Im not sure where im going wrong and would like some help if possible. PS. I know frames are terrible but im still playing around with web deving. Quote
Sparda Posted January 26, 2007 Posted January 26, 2007 What you are doing wrong: you are using JavaScript How you can fix it: Don't use JavaScript Any good web must not require JavaScript to be enabled for it to function, else it's clearly not a good web site and probably not worth visiting. Quote
jool Posted January 26, 2007 Posted January 26, 2007 What you are doing wrong: you are using JavaScriptHow you can fix it: Don't use JavaScript Any good web site shouldn't require JavaScript to work. I was going to pick on the use of frames which really should be discouraged but he already knew that apparently. But you are right, a page shouldn't require JavaScript to function but I do think it is a great tool to enhance the functionality of a page. As for doing the printing, I find that the nicest way of doing it is having a normal link to a page (without frames) which is formatted for printing. In that page you have the JavaScript code to print the page run on load, in that way you get around a lot of problems (how different browsers handles frames, printing, etc) and don't require JavaScript to function. Quote
Sparda Posted January 26, 2007 Posted January 26, 2007 Admittedly JavaScript is usful if it enhances the page in some way. Case and point: phpbb doesn't require you have have JavaScript enabled at all, but if you do enable it you get stuff like page auto forwarding, and popups when you get PMs and good stuff like that. Quote
film Posted January 27, 2007 Author Posted January 27, 2007 How wierd, last night it wasnt working know it is (my JavaScript)? *baffled* :?: Quote
psychoaliendog Posted January 27, 2007 Posted January 27, 2007 You could just get away with not having a separate page altogether by using a print style sheet. This Article does a good job of explaining it. So that way the user could just use the print button in the browser. :D Quote
jool Posted January 27, 2007 Posted January 27, 2007 You could just get away with not having a separate page altogether by using a print style sheet. This Article does a good job of explaining it. So that way the user could just use the print button in the browser. :D Have you tried that? I'm curious to know if it really works or if it just is another of those practical but ignored standards. Quote
psychoaliendog Posted January 28, 2007 Posted January 28, 2007 It works in any modern browser. I've heard that it may be a little buggy in the last gen of browsers (FF1.0, IE6, Opera8), but who uses those anyway. Quote
film Posted January 29, 2007 Author Posted January 29, 2007 It works in any modern browser. I've heard that it may be a little buggy in the last gen of browsers (FF1.0, IE6, Opera8), but who uses those anyway. Using FireFox 2.0 ? Quote
psychoaliendog Posted January 29, 2007 Posted January 29, 2007 Using FireFox 2.0 ? ummm... yes. Not sure exactly what you are talking about, but yes I'm using FF2.0, and yes print stylesheets work in FF2.0. A List Apart has a really good print stylesheet. Do a print preview of the page to see what I mean. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.