Preparation and application of magnetic polymers for targeting of drugs