Django中加入Flexpaper报错:FlexpaperView not define

shuihaijin 2018-01-14 10:44:31
小弟最近需要做一个flexpaper在线预览的项目,想用Django做权限控制,也就是把flexpaper嵌入到Django中。
现在:1、将FlexPaper的js、css目录分别放在我自己App/static/flexpaper/js和App/static/flexpaper/css下;
2、将flexPaperViewer.swf放在了App/static/flexpaper/下;
3、将flexpaper下的index.html放在了myproject/template下。
其他Django配置均正常,但是chrome后台报错:Uncaught ReferenceError: FlexPaperViewer is not defined

这是template下我要加载flexpaper的模板,请各位看看问题出在哪里?谢谢!
<!DOCTYPE html>
<html lang="en">
{% load static %}
<head>
<script type="text/javascript" src="{% static "flexpaper/js/jquery.min.js" %}"> </script>
<script type="text/javascript" src="{% static "flexpaper/js/flexpaper.js" %}"> </script>
<script type="text/javascript" src="{% static "flexpaper/js/flexpaper_handlers.js" %}"></script>
<script type="text/javascript" src="{% static "flexpaper/js/flexpaper_handlers_debug.js" %}"></script>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body >

<h1 style="background-color: antiquewhite; color:black;">hello world!</h1>
<h1 title="...">用户输入</h1>
<form action="/index/" method="post">
<input type="text" name="username">
<input type="passwd" name="passwd">
<input type="submit" name="submit">
</form>
<hr/>
<h1 style="...">用户展示</h1>
<table border="1">
<thead>
<th>username</th>
<th>passwd</th>
</thead>
<tbody>
{% for line in data %}
<tr>
<td>{{ line.user }}</td>
<td>{{ line.pwd }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<script src="{% static "js/jquery-3.2.1.min.js" %}"></script>

<!--<div style="position:absolute;left:10px;top:10px;">
#<div id="documentViewer" class="flexpaper_viewer" style="width:770px;height:500px"></div>-->
<div style="position:absolute;left:10px;top:10px;">
</div>
<a id="viewerPlaceHolder" style="width:660px;height:480px;display:block"></a>
<script type="text/javascript">

var fp = new FlexPaperViewer(
'FlexPaperViewer',
'viewerPlaceHolder', { config : {
SwfFile : "docs/bitcoin.swf",
Scale : 0.6,
ZoomTransition : 'easeOut',
ZoomTime : 0.5,
ZoomInterval : 0.2,
FitPageOnLoad : true,
FitWidthOnLoad : false,
PrintEnabled : true,
FullScreenAsMaxWindow : false,
ProgressiveLoading : false,
MinZoomSize : 0.2,
MaxZoomSize : 5,
SearchMatchAll : false,
InitViewMode : 'Portrait',

ViewModeToolsVisible : true,
ZoomToolsVisible : true,
NavToolsVisible : true,
CursorToolsVisible : true,
SearchToolsVisible : true,

localeChain: 'en_US'
}});
</script>
</body>
</html>
...全文
314 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
random7 2018-01-15
  • 打赏
  • 举报
回复
看一下是不是settings文件中的STATICFILES_DIRS配置的对不对 未定义一般都是没配置好

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧