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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • 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.