Compressed air is safe to use on electronics, as long as you keep the canister moderately upright when you're blasting dust away. If you invert the can or tip it over too much, you'll actually land up spraying the liquid form of compressed air- which freezes on contact and can destroy electrical components.
Also, a lot of people are saying they use vacuum cleaners in combination with compressed air. This is a remarkably stupid thing to do. Compressed air is not really "compressed air" (that is, the stuff you breathe)- it's actually a commercial refrigerant, specifically R152A.
R152A is FLAMMABLE. It will happily ignite in the presence of oxygen and an open flame or spark at volumes as low as 3.9% in air and as high as 16.9%. If you suck this stuff up with your vacuum cleaner, you run the risk of creating an explosion- don't laugh- I've seen a vacuum cleaner burst into flames just by sucking in evaporated R152A. The brushes inside the vacuum cleaner motor are a constant source of electrical arcing and they will ignite flammable gasses sucked up by the hose.
If you don't believe me, here's the MSDS safety sheet for R152A:
http://www.refrigerants.com/msds/r152a.pdf
So, basically, to recap:
1) Never invert or tip the canister while spraying. If you do you'll land up blasting a jet of white liquid that freezes stuff on contact. If you mistakenly do this to a PCB, you can cause the components to shatter or crack off, destroying your equipment.
2) Never ever use compressed air in the vicinity of an open flame or electrical spark/arc. You should unplug anything you're cleaning out prior to using the compressed air on it. As I said above, using a vacuum cleaner might seem like a smart idea but it's not- you run the risk of igniting the compressed air and causing a fire. It is better to dust things out outside or in a garage if you can.
-SC