简体   繁体   English

Dropbox Drop ins重绘/重新初始化“保存到Dropbox”按钮

[英]Dropbox drop ins redraw/reinitialize Save to Dropbox button

I'm using javascript client side routing/ajax. 我正在使用javascript客户端路由/ ajax。 So when the page loads and Dropbox's drop-in api scans the page for buttons like this: 因此,在页面加载时,Dropbox的嵌入式api会在页面上扫描如下所示的按钮:

<a href="https://dl.dropboxusercontent.com/s/deroi5nwm6u7gdf/advice.png" class="dropbox-saver"></a>

The DOM for the a has not yet been drawn. 对于该DOM a尚未得出。

Is there a way to get the Drop-in API to rescan the page after the page has loaded correctly so that the button can appear? 有没有一种方法可以使Drop-in API在页面正确加载后重新扫描页面,以便可以显示按钮?

I don't think there's a way to cause the library to re-scan the page, but you can always create the Saver button yourself, eg Dropbox.createSaveButton(url, filename); 我认为没有办法使库重新扫描页面,但是您始终可以自己创建Saver按钮,例如Dropbox.createSaveButton(url, filename); . (See https://www.dropbox.com/developers/dropins/saver#creating-buttons for details.) (有关详细信息,请参见https://www.dropbox.com/developers/dropins/saver#creating-buttons 。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM