Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted
What you are doing wrong: you are using JavaScript

How 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.

Posted

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.

Posted

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

Posted
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.

Posted

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. :wink:

Posted
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. :wink:

Using FireFox 2.0 ?

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...