Origins of "polly wants a cracker"?

where did this saying come from? why is it always a cracker? why is "polly" the generic name for a parrot?
5 answers 5