Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7581275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:09:42+00:00 2026-05-30T18:09:42+00:00

suppose I have a nomal function: function begin(e) { e.dataTransfer.effectAllowed = ‘copy’; e.dataTransfer.setData(‘text’, this.id);

  • 0

suppose I have a nomal function:

    function begin(e) {
        e.dataTransfer.effectAllowed = 'copy';
        e.dataTransfer.setData('text', this.id);
    }

I want the same function could appear in one element’s live function:

    $('img.clone').live('click', function (e) {
        e.dataTransfer.effectAllowed = 'copy';
        e.dataTransfer.setData('text', this.id);
    })

situation1:the firebug would say the e.dataTransfer is undefined?
however,if I change to this :

$('img.clone').live('click', function () {
       begin(e);
})

this could not doesn’t work ,it also says e.dataTransfer is undefined,

but if I use it in addEventListener(‘dragstart’, begin, false),this could work?

So how can I pass the “e” correctly in live() method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:09:43+00:00Added an answer on May 30, 2026 at 6:09 pm

    e.dataTransfer is undefined not e.

    Try

    e.originalEvent.dataTransfer…

    jQuery stores the original event in e.originalEvent, the e itself is not a real event object but a normal object that jQuery created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose i have pointer to a thread like this CWinThread *m_pThread = AfxBeginThread(StartThread, this,
Suppose I have data Foo = A String Int | B Int I want
Suppose I have the number 1.29999 . I want to just have 1.2 without
Okay, suppose we have a line of text: [s]tackoverflow rocks where the brackets show
Suppose I have drawn simple text (say just the letter 'x') with some font
Suppose if I have a random time series that I want to interpolate over
Suppose I have an DevExpress ASPxTextBox whose id is instrument. I want to access
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX
Suppose we have a table A: itemid mark 1 5 2 3 and table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.