我有一些问题,使JavaScript与Django模板继承工作。根据Opera的所有JavaScript和他们的CSS文件加载罚款,但JavaScript不起作用,而不是Javasrcript表普通的HTML表格显示。如果我从孩子中删除所有的继承标签,一切正常。JavaScript doesen't与Django模板继承工作
我一直在使用Dreamweaver制作这些文件,但是我怀疑这个问题对这个问题是否有任何实际影响。
父 - base.html文件头:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
<link href="/SpryAssets/css/base_new.css" rel="stylesheet" type="text/css"><!--[if lte IE 7]>
<style>
.content { margin-right: -1px; }
ul.nav a { zoom: 1; }
</style>
<![endif]-->
<style type="text/css">
.item_table_main { border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
</style>
</head>
<body>
孩子的头:
{% extends "base_new.html" %}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
<style type="text/css">
{% block css %}
body table tr {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
background-color: #FFF;
border: 0px none #FFF;
}
</style>
<script src="/SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script src="/SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<link href="/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css">
<link href="/SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css">
<style type="text/css">
#apDiv1 {
position:absolute;
width:382px;
height:252px;
z-index:1;
left: 1169px;
top: 616px;
}
#apDiv2 {
position:absolute;
width:1575px;
height:138px;
z-index:2;
}
{% endblock css %}
</style>
</head>
看来,这已经没有什么做头。 Dreamweaver中的child.html
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var CollapsiblePanel9 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel9", {contentIsOpen:false});
var CollapsiblePanel8 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel8", {contentIsOpen:false});
var CollapsiblePanel6 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel6",
</script>
我没有包括到内容块的结束产生的这个脚本 - 我花了半天摸不着头脑,P。
感谢大家的帮助。
你能告诉我们_generated_标记吗? – 2012-04-13 17:19:22
你说父文件是base.html,但是子文件扩展了base_new.html。它是否像打字错误一样简单?此外,在向SO和问题论坛发布示例时,请尽可能多地留下证明问题的最低限度。我们更可能将n粘贴,然后问题更容易发现。 – Spacedman 2012-04-13 18:34:42