Im trying to open a popup window with an embedded Dropbox folder when a user hits a button.
When I hit the button, it opens a blank popup.
When I turn on the Developer > Javascript console (in safari) I see an error when the Dropbox.embed command runs.
The error is: "Error: appkey must be provided"
I am using the <script> line with the appkey directly copied from dropbox (cut and paste). I replaced the appkey with all xxxx's just for this posting.
The var LinkID = [@field:Digital_File_link] pulls in the correct Dropbox link, https://www.dropbox.com/xxxxx and I verify this with the window.alert(LinkID) line.
The chooser / Saver / Embedder domains value is set to the domain the script is running on.
What am I missing?
Thanks in advance!
The following code is what I am using.
---------
<button onclick="openDropboxLink()">Open Dropbox Link</button><script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="xxxxxxxxxxxxxxx"></script>
<script>
var LinkID ='[@field:Digital_File_link]';
function openDropboxLink() {
window.alert(LinkID);
var options = {
link: LinkID,
folder: {
view: "list",
headerSize: "normal"
}
};
var element = window.open('', '_blank', 'width=1200, height=800');
Dropbox.embed(options, element);
}
</script>