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 9114677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:15:12+00:00 2026-06-17T04:15:12+00:00

Jquery: $(document).ready(function () { $(‘input[type=file]’).uploadImage(); jQuery.event.props.push(‘dataTransfer’); $(.upload-cont).bind(‘dragenter’, function (e) { $(.upload-cont).css(border, 1px dashed black;);

  • 0

Jquery:

$(document).ready(function () {
   $('input[type=file]').uploadImage();
   jQuery.event.props.push('dataTransfer');
   $(".upload-cont").bind('dragenter', function (e) {
      $(".upload-cont").css("border", "1px dashed black;");
   });
   $(".upload-cont").bind('drop', function (e) {
      var files = e.dataTransfer.files;
      e.preventDefault();
   });
   $("body").bind('drop', function (e) {
      e.preventDefault();
   });
});

In firefox 17,explorer 8 when dragging and dropping a file from desktop into browser the image will be loaded in another page. I had added preventDefault() which works perfectly in chrome. What can be done so that the action is prevented in ff,ie browser.

  • 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-06-17T04:15:14+00:00Added an answer on June 17, 2026 at 4:15 am

    Try changing the code to be.

    $('body').on('dragover drop', function(e){
        e.preventDefault();
    });
    

    The dragover event has to be cancelled also for certain browser to listen to the drop. To quote the mdn

    A listener for the dragenter and dragover events are used to indicate
    valid drop targets, that is, places where dragged items may be
    dropped. Most areas of a web page or application are not valid places
    to drop data. Thus, the default handling for these events is to not
    allow a drop.

    If you want to allow a drop, you must prevent the default handling by
    cancelling the event. You can do this either by returning false from
    an attribute-defined event listener, or by calling the event’s
    event.preventDefault method. The latter may be more feasible in a
    function defined in a separate script.

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

Sidebar

Related Questions

HTML: <input type=text id=priceperperson1 name=priceperperson1 /> <input type=text name=personsvalue1 class=countme readonly=readonly /> JS: jQuery(document).ready(function($)
jQuery(document).ready(function($) { $('input[type="text"]').live('focus', function() { if (this.value == 'someValue') { this.select(); } }); });
I wrote this function: jQuery(document).ready(function() { jQuery('input[type=text]').each( function(i) { thisval = jQuery(this).val(); jQuery(this).blur( function()
This is my jQuery code <script type=text/javascript> jQuery(document).ready(function($){ $(#'.$tag.').dcFlickr({ limit: '.$nFlickr.', style: thumb, q:
<script type=text/javascript> jQuery(document).ready(function(){ setTimeout(function(){ jQuery('.my-image').each(function(){ jQuery(this).greyScale({ fadeTime: 200, reverse: false }); $(this).animate({ 'opacity' :
I have updated my jSon object using the code <script type=text/javascript > jQuery(document).ready(function($){ var
I got the following code : <script type=text/javascript> jQuery(document).ready(function(){ var Opened = false; jQuery('.expend-schedule').click(function(e){
<script type=text/javascript> jQuery(document).ready(function() { jQuery(.content).hide(); jQuery(.link).click(function() { jQuery(div.content).slideToggle(500); });; }); </script> How to expand
I'm using the following code to load in content: <script type=text/javascript> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery('.content-div').load(all-events.html);
I have the below code in my jqgrid <script type=text/javascript> jQuery(document).ready(function() { var grid

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.