ฉันมีปัญหาบางอย่างในการทำให้ Javascript ทำงานกับการสืบทอดเทมเพลต Django ตาม Opera จาวาสคริปต์ทั้งหมดและไฟล์ CSS โหลดได้ดี แต่ Javascript ไม่ทำงานแทนตาราง Javasrcript ตาราง html ธรรมดาจะปรากฏขึ้น ถ้าฉันลบแท็กการสืบทอดทั้งหมดออกจากลูก ทุกอย่างก็ทำงานได้ดี
ฉันใช้ 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="/th/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="/th/SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css">
<link href="/th/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
ขอบคุณสำหรับความช่วยเหลือของคุณทุกคน