cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Picker error on Internet Explorer 11 when invoked during page load

Picker error on Internet Explorer 11 when invoked during page load

rrpai
Helpful | Level 5
Go to solution

- i am loading file picker when a html page loads

- on Firefox, Chrome, Microsoft Edge  browsers it works fine

- On IE-11 it gives error.

error in console
> SCRIPT5022: Failed to open/load the window. Dropbox.choose and Dropbox.save should only be called from within a user-triggered event handler such as a tap or click event.
jquery.min.js (2,31689)

In picker
> Could not communicate with https://host:port/

- after that picker doesnt work.

- pls comment. Also pls comment why behaviour is different in browsers and issue is only with IE-11

http://localhost:8000/DropboxPicker.html

// simplified test
function loadPicker()
{
    let options = {
        success: printSelectedFile,
        linkType: "direct",
        multiselect: true
    };
    Dropbox.choose(options);
}
function printSelectedFile()
{
  ..
}
// load picker $(document).ready(loadPicker);
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Every browser is implemented differently, so different behaviors may be expected across browsers. (For what it's worth though, I do see the same error here using your code in Chrome on macOS as well.)

In any case, you should only start the Chooser from a user-triggered event. E.g., call Dropbox.choose when a button is hit; something like:

    $(document).ready(function() {
        $("#button").on('click', function(e) {
            Dropbox.choose(options);
        });
    });

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

Every browser is implemented differently, so different behaviors may be expected across browsers. (For what it's worth though, I do see the same error here using your code in Chrome on macOS as well.)

In any case, you should only start the Chooser from a user-triggered event. E.g., call Dropbox.choose when a button is hit; something like:

    $(document).ready(function() {
        $("#button").on('click', function(e) {
            Dropbox.choose(options);
        });
    });
Need more support?