jQuery : Event not binding in IE 10

I want to attach a double click event on an ID/Element if there is a single left click on that same ID/Element.

for Ex my code is

if($("#file_upload").length > 0)
{
    $("#file_upload").on('mousedown', function() {
        $("#file_upload").dblclick(); //This thing not working in IE 10
    });             
}

this issue is while using jQuery.fileUpload. jQuery version is 1.8.2

also i m binding event on mousedown so it might get triggered on right click but i want event binding only on left click

Answers


You're not telling the code what to do when the double click occurs.

Just as other events, the code should be told what to do when it occurs..

  if($("#file_upload").length > 0)
  {
    $("#file_upload").on('mousedown', function() {
        $("#file_upload").dblclick(function () {
            alert("Double click!");
        });
     });                
  }

Next to this, i'm wondering it it'll work.. it's expecting to have a mouse down and seeing a double click occur.. when releasing the mouse button for a double click, i assume it'll leave the mousedown event, and the double click event won't be fired.

Might require some testing in this case.


Need Your Help

php preg replace :: regex

php regex preg-replace

If I have a string that looks like my name is {your name here} and I am from {country}.

reading data from filesystem vs compiling the data directly into program

c io

I have a file (10-20MB) containing data, where each line is a single piece of data.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.