I tried drag and drop in HTML. It is working good in all browsers except IE9 (no need to work on lower than IE9). ondrop event is not triggered in IE9.
any help? here is my code.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’ll work if you replace
divwithatags. However there are a couple of other changes you ought to make, firstly make sure that theatags aren’t clickable links by returningfalsein theonclickevent:Secondly, IE9 doesn’t accept parameters of
text/plaininsetData, useTextinstead or add the data inside of atry...catch. Also, you should make sure the data you’re adding is actually text:Finally your
handleDropfunction needs topreventDefault/return falsebecause otherwise the default action for dropping a link (anaelement`) is to navigate to the dropped URL:Here is a jsFiddle of your code which will work in IE9.