Jump to content
Sign in to follow this  
jamfitz001

javascript Drag/Drop - IE not getting it right.

Recommended Posts

I'm adapting some straightup examples of  Drag / Drop from W3school.   Everything seems to work with other Browsers as expected.  IE is not working.

I have an HTML object on my page:

<div  id="1717" class="mydrag_obj" draggable='true' ondragstart='func_dragstart(event)'>  

      <a href="https://www.yahoo.com" target="_blank">  

                  <div class="row_1"></div>

                  <div class="row"_2"></div>

     </a></div>

JavaScript:

func_dragstart(ev) { ev.dataTransfer.setData("text/plain", ev.target.id);}

When I drop -

func_dropped_dropzone (ev) { ev.preventDefault();  alert ('card_id- ' + ev.dataTransfer.getData("text")); return true; }

For all browsers  ev.dataTransfer.getData("text"))  

...the alert =   card_id=1717   

but for

  IE  the alert =   card_id="https://www.yahoo.com"

can someone explain what I need to do to make IE return the ID of the DIV?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.