admin管理员组文章数量:1025477
<!DOCTYPE html>
<html>
<head>
<title>DropBox Chooser Example</title>
</head>
<body>
<div id="main">
<input type="dropbox-chooser" name="selected-files" data-link-type="direct" id="db-chooser"/>
<div id="content"></div>
</div>
<script type="text/javascript" src=".js" id="dropboxjs" data-app-key="YOUR-APP-KEY"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery-layout.js"></script>
<script type="text/javascript">
$(function(){
var dbChooser = $("#db-chooser");
dbChooser.on("DbxChooserSuccess", function(e) {
// Here we will listen when a file is
// chosen from dropbox, insert it into the page
// and initialize the Jcrop plugin
e = e.originalEvent;
var name = e.files[0].name;
});
});
</script>
</body>
</html>
This is my example code in which i am trying to implement the dropbox chooser. I have created an app and i do pass the app key. The errors i encounter are,
Initially on page load, i get the error that $(...).on is not a function.
When i click on the dropbox chooser button, i get {"error": "Invalid origin"}.
I am not getting where i am going wrong. Any help will be appreciated.
<!DOCTYPE html>
<html>
<head>
<title>DropBox Chooser Example</title>
</head>
<body>
<div id="main">
<input type="dropbox-chooser" name="selected-files" data-link-type="direct" id="db-chooser"/>
<div id="content"></div>
</div>
<script type="text/javascript" src="https://www.dropbox./static/api/1/dropins.js" id="dropboxjs" data-app-key="YOUR-APP-KEY"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery-layout.js"></script>
<script type="text/javascript">
$(function(){
var dbChooser = $("#db-chooser");
dbChooser.on("DbxChooserSuccess", function(e) {
// Here we will listen when a file is
// chosen from dropbox, insert it into the page
// and initialize the Jcrop plugin
e = e.originalEvent;
var name = e.files[0].name;
});
});
</script>
</body>
</html>
This is my example code in which i am trying to implement the dropbox chooser. I have created an app and i do pass the app key. The errors i encounter are,
Initially on page load, i get the error that $(...).on is not a function.
When i click on the dropbox chooser button, i get {"error": "Invalid origin"}.
I am not getting where i am going wrong. Any help will be appreciated.
Share Improve this question edited Sep 11, 2013 at 14:52 tim peterson 24.4k63 gold badges186 silver badges303 bronze badges asked May 7, 2013 at 5:47 Swanand PhadkeSwanand Phadke 777 bronze badges1 Answer
Reset to default 7I ran into, and was able to resolve, this same issue today. The Dropbox Chooser functionality does not support file browsing unless the script is running on a web server. If you are testing your web app locally and are accessing it via a file:// link, you will get the 'invalid origin' error. Instead, run a web server (either locally or hosted somewhere else) with your web app on it, and that should eliminate the error.
<!DOCTYPE html>
<html>
<head>
<title>DropBox Chooser Example</title>
</head>
<body>
<div id="main">
<input type="dropbox-chooser" name="selected-files" data-link-type="direct" id="db-chooser"/>
<div id="content"></div>
</div>
<script type="text/javascript" src=".js" id="dropboxjs" data-app-key="YOUR-APP-KEY"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery-layout.js"></script>
<script type="text/javascript">
$(function(){
var dbChooser = $("#db-chooser");
dbChooser.on("DbxChooserSuccess", function(e) {
// Here we will listen when a file is
// chosen from dropbox, insert it into the page
// and initialize the Jcrop plugin
e = e.originalEvent;
var name = e.files[0].name;
});
});
</script>
</body>
</html>
This is my example code in which i am trying to implement the dropbox chooser. I have created an app and i do pass the app key. The errors i encounter are,
Initially on page load, i get the error that $(...).on is not a function.
When i click on the dropbox chooser button, i get {"error": "Invalid origin"}.
I am not getting where i am going wrong. Any help will be appreciated.
<!DOCTYPE html>
<html>
<head>
<title>DropBox Chooser Example</title>
</head>
<body>
<div id="main">
<input type="dropbox-chooser" name="selected-files" data-link-type="direct" id="db-chooser"/>
<div id="content"></div>
</div>
<script type="text/javascript" src="https://www.dropbox./static/api/1/dropins.js" id="dropboxjs" data-app-key="YOUR-APP-KEY"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.tools.min.js"></script>
<script type="text/javascript" src="jquery-layout.js"></script>
<script type="text/javascript">
$(function(){
var dbChooser = $("#db-chooser");
dbChooser.on("DbxChooserSuccess", function(e) {
// Here we will listen when a file is
// chosen from dropbox, insert it into the page
// and initialize the Jcrop plugin
e = e.originalEvent;
var name = e.files[0].name;
});
});
</script>
</body>
</html>
This is my example code in which i am trying to implement the dropbox chooser. I have created an app and i do pass the app key. The errors i encounter are,
Initially on page load, i get the error that $(...).on is not a function.
When i click on the dropbox chooser button, i get {"error": "Invalid origin"}.
I am not getting where i am going wrong. Any help will be appreciated.
Share Improve this question edited Sep 11, 2013 at 14:52 tim peterson 24.4k63 gold badges186 silver badges303 bronze badges asked May 7, 2013 at 5:47 Swanand PhadkeSwanand Phadke 777 bronze badges1 Answer
Reset to default 7I ran into, and was able to resolve, this same issue today. The Dropbox Chooser functionality does not support file browsing unless the script is running on a web server. If you are testing your web app locally and are accessing it via a file:// link, you will get the 'invalid origin' error. Instead, run a web server (either locally or hosted somewhere else) with your web app on it, and that should eliminate the error.
本文标签: javascriptquoterrorquot quotInvalid originquot using dropbox chooserStack Overflow
版权声明:本文标题:javascript - "error": "Invalid origin" using dropbox chooser - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745630026a2160104.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论