You are close, you just need to hook into the add
event instead of the reset
event. (In case you did not know, these are standard events provided by Backbone collections. So familiarizing yourself with that will be helpful when developing things around stuff where WordPress employs Backbone.js.)
So basically you’d modify your code like this:
if (typeof wp.Uploader !== 'undefined' && typeof wp.Uploader.queue !== 'undefined') {
wp.Uploader.queue.on('add', function() {
console.log('image uploaded!');
});
}
Related Posts:
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- Add tinymce buttons to caption textarea in media uploader
- How to handle multiple instance of “send_to_editor” js function
- Modify Custom Field in Media Library using JavaScript
- Script won’t execute in the media manager
- Is it possible to hide media details sidebar when wp.media popup is being opened?
- Getting all URLs of uploaded images using media uploader
- How to locate the js code and php code for certain function?
- wordpress file upload from direct directory not working
- Add jQuery function to media button
- JavaScript sleep/wait before continuing [duplicate]
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How do I link a JavaScript file to a HTML file?
- jQuery equivalent of JavaScript’s addEventListener method
- Adding an onclick function to go to url in JavaScript?
- Checking a Url in Jquery/Javascript
- Best way to store a key=>value array in JavaScript?
- When and why to ‘return false’ in JavaScript?
- Format date to MM/dd/yyyy in JavaScript
- How is JavaScript .on() method defined?
- Javascript isnull
- JQuery: $.get is not a function
- How to read data From *.CSV file using javascript?
- How can I expand and collapse a using javascript?
- Javascript : array.length returns undefined
- Custom “Uploads” Dir: “Edit Image” in Media Library broken
- WordPress AJAX File Upload – FrontEnd
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- WP 3.5 media manager – how to create a working gallery frame
- Add custom shortcode button to Editor
- Infinite scroll / lazy loading with NextGen Gallery [closed]
- jQuery UI Datepicker not working
- Defer Parsing of Scripts
- How to get the image url in the input box from media library?
- Including javascript for a shortcode
- Asynchronous Javascript Loaders
- Unable to run jQuery script in my template file
- How to Use JSON With AJAX?
- Using wp_ajax and wp_ajax_nopriv hooks
- Hide/show customizer controls based on other settings in Customizer
- How do I get my page to load the jQuery UI Effects library?
- Restrict file types in the uploader of a wp.media frame
- How to add unique image class to WordPress
- WP Media uploader loading only once in options page
- Dropzonejs with WPCF7 [closed]
- Edit single attachment on click (WP-admin)
- Refreshing collections in the admin media manager
- jQuery Tree View and wp_list_pages
- Jquery conflict
- wp_enqueue_media() Will not load JS on the theme
- Loading posts via AJAX in a hidden div with updated URL?
- wpColorPicker: How update colors on input value update?
- How to show jquery popup only in one page or once?
- Front-end Ajax File Upload
- WooCommerce Ajax Cart Update Stopped Working
- WordPress Media frame pre load images from ids
- Limit filetype and wp media
- Send multiple attachments with JQuery and wp_mail() function
- How do I Import / Upload Files with jQuery AJAX?
- How to return multiple arguments from AJAX callback function
- JS news ticker is not working on home page but working on other pages. How to solve this?
- Using jquery-1.7.2.min.js instead of the wordpress jquery
- WP Customizer compare and set a value via javascript
- “JQMIGRATE: Migrate is Installed” How do I find the problem code? [duplicate]
- Referrer URL with jQuery or Javascript – Cache & Referrer URL Issue
- Create special WordPress slideshow with “jquery.cycle.all.js”
- Using Foundation 5 in WordPress Administration Area
- Ajax Validation for reCaptcha
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- jQuery selectable() function won’t work in wordpress
- oEmbed Video in Modal
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- How To Include JavaScript Files Only In Single Posts?
- wordpress before or after javascript problem
- Ajax page load in wordpress the right way?
- wp not defined at wp.Uploader.prototype
- I am trying to Implement a Code that is Working in my previous page but not working in WordPress for some reason
- How to use $ with externally loaded javascript
- Getting click on item to open closest relevant element (popup) with jQuery
- How to make JQuery load on top of head tag before everything
- Customizer add query to preview URL
- why does so many javascript libraries are loaded along with my website?
- wordpress ajax upload media not working
- Why does my media selection script write to ONLY the first input field?
- Modify the href attribute of tag dynamically in WordPress
- Add a jQuery snippet for sepcific user role
- Bootstrap with separate js File
- Move jQuery on *top* of footer
- JQuery and Javascript to pan image
- How to blur the_post_thumbnail() via blur.js (jquery)?
- How to get this jQuary script working?
- Youtube Iframe Api play one video at a time
- How to add JS snippet before closing tag?
- Disable drag metaboxes, create many functions using js not to work!
- Are you sure popup on Contact Form 7 [closed]
- jQuery ajax empty exeption on wordpress
- Edit Image/Image Details – Replace button missing
- Custom jQuery plugin not working
- JS file not loading [closed]
- Javascript Loading Effect to URLs