Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am very new at this. Where do I put the JavaScript at to make the chooser appear on my webpage?
This link says to use the JavaScript.
https://www.dropbox.com/developers/dropins/chooser/js#triggering
Sounds like you might want to start here:
JavaScript Introduction: Where To
http://www.w3schools.com/js/js_whereto.asp
The demo instructions on the Dropbox website tell you what to embed on the page
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="YOUR_APP_KEY"></script>
The JavaScript code on a web page should go in a <script>
tag. As for when to run it, for the JavaScript that creates the button, you'll probably want to run that when the page loads. How exactly you do that depends on what libraries you're using, if any, (e.g,. jQuery, etc.), so I can't answer that specifically for you.
Of, if you are using a custom button instead, the JavaScript to trigger the Chooser to appear should be run from the event caused by the user (e.g., when they click a custom button or like on your page).
Okay, so I added this
<button type="button">Try it</button>
after
<style>
var button = Dropbox.createChooseButton(options);
document.getElementById("container").appendChild(button);
</style>
I do not think that was was I was supposed to do.
Your button doesn't seem to be hooked up to anything, and you added your JavaScript code inside a <style>
tag instead of a <script>
tag.
I recommend reading through the Chooser documentation again, and getting some help with the general HTML/CSS/JavaScript development for your page if you're having trouble. That's outside the scope of Dropbox API support of course though, so I can't offer much help there.
I have a simple sample page that uses the Chooser here though:
https://dl.dropboxusercontent.com/u/27506755/chooser_js_simple.html
You can look at the source to see how it works.
I very much thank you for all your help. I am actually starting to get somewhere with all other this.
Okay, so I have this
https://www.dropbox.com/s/5ytuljdzhg4i07x/Screen%20Shot%202015-07-15%20at%203.37.51%20PM.png?dl=0
but I get this
https://www.dropbox.com/s/6a5ya9zogitjfz7/Screen%20Shot%202015-07-15%20at%203.39.25%20PM.png?dl=0
What am I doing wrong?
When using Drop-ins the domain(s) you want to use it on must be pre-registered on the App Console:
https://www.dropbox.com/developers/apps
Click on your app there and enter the domain for your site in "Drop-ins domains".
Thanks Greg! It works! Unfortunately though this is not what I thought It was. I need the users to be able to view and download from a specific app folder and only that specific app folder without having to sign in. Is there something like that?
No, there currently isn't a way to restrict the Chooser to a certain path like that, but I'll be sure to pass this along as a feature request.
(Unless you mean you want them to be able to view and download from your account only? In that case, you may just want to use a shared link to a folder in your account: https://www.dropbox.com/help/167 )
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!