RSS
 

Archive for the ‘Windows’ Category

Fix your Javascript Print Style Switcher for Internet Explorer

19 Feb

So you’ve decided to use javascript to swap out a print style css sheet that basically hides a bunch of divs and maybe widens the content area. Perhaps your re-color the links and the text and fix the font sizes.

You try it in Firefox and it prints perfectly, but when you print in IE, you’ll notice IE didn’t really print your printable version.

So you think, ‘Ok I’ll add media=”print” to my stylesheet link!’ and then you refresh your page, try your Print this Page link, and nothing happens! And it still prints the wrong version! What to do?

Well, your old pal Joe here figured it out.

Here’s what you do:

  1. Create a separate stylesheet called print.css
  2. Add this code to your master stylesheet:

    @media print {

    @import "print.css";

    }

  3. Implement your javascript for making the stylesheet override your master stylesheet
  4. Test
  5. Enjoy!

This allows you to switch to your print style so it is preview-able before printing and also tells IE to use print.css when it prints a page on your site. So incidentally, if a user just clicks print in IE without switching to your style, they will still get your printable version. I suppose this might cause confusion but considering the most reasons for making hard copies of digital information, it probably shouldn’t pose too much of a problem for your average user.

Now if your user wants to have a pretty print out of your website because they can’t access a computer to show it to someone else away from home, they’ll probably get stuck with the fact that IE does not print background images and colors by default any way.

 

FLV Not Working on Live Web Server

19 Jan

I’m posting this hoping that if someone else is Googling* this issue, I’ll make it a little easier to find.

While developing a redesign for a client, we started implementing a flash-based slideshow in the top corner of their home page, with the ability to play an FLV file over the slideshow. Eric did a fine job making the SWF, and the transitions worked quite well.

One little problem: as soon as we uploaded our flash to the server and attempted to play it, it would not load the video. We thought it was a permissions problem because it’s a development website and is password protected until it goes live in order to serve the privacy concerns of the client. So I fumbled around with that for a bit with no results.

I finally decided to try Google. After a couple misses, I finally found the solution to my FLV file problem. The steps in this document worked for me. Turns out you need to set the FLV MIME type on your Windows 2003 server, and restart the World Wide Web Publishing Service.

We don’t have the option of just restarting our IIS service willy nilly, so I had one of our techs schedule a task on the server to restart the service at 2:30 this morning. When I came in and loaded the client’s site, it worked like a charm!

* Googling is not in the OS X dictionary! I added it.