The key again is to befriend people. If you become friends with your spectators, they'll be on your side - as long as your magic is solid, they'll want to see more. I've seen it happen, they'll tell the heckler themselves to shut up. You can chip in with a line like "If you know it that's great, but don't spoil the secret for the rest of the guys ok? Just watch for a little." Then you can offer to have a serious discussion into the construction of sleight of hand magic after the performance, if they'd like. That's for the "I know how it's done" spectator. If they're generally just trying to be funny and cracking jokes, tell them something along the lines of if they don't want to watch, they don't have to - but others want to watch magic - and actually ask, "You guys wanna see more?" This positive reinforcement from them helps a lot. The guys that try to physically do stuff, very rare, but if they knock your deck out of your hands, just smile and say that he obviously doesn't like watching, so pack up and leave - and most importantly of all - move on. Doesn't matter. These guys are jerks that will never get anywhere in life, so don't let that stop you spreading magic.
There are a lot of threads around about how to deal with hecklers, so do a forum search
Zack, magicman's reason is that perform for people you don't know - but don't treat them as strangers, perform for them as though they were family and friends, which is good advice.
Magicator, you will get the occasional idiot, but at the end of the day, he's occasional, and he's an idiot, so you know, he's not really worth losing sleep over. The best way to get confidence though is just to grit your teeth and do it. Performance experience helps so much in getting rid of nerves. Performing is addictive for me, after I do one that goes well, I want to do it more often, and performances give you confidence.