Jump to content

javascript Drag/Drop - IE not getting it right.


jamfitz001

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?

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.