JQuery 框架集

JQuery Frameset

您好,我有一个带有嵌套框架的产品。

在start.htm中我定义了框架集。这也是部分。 在第二部分中,我在 b-home.htm.

中定义了一个新的框架集

当我在 b-home.htm 的上下文中使用来自导航 (sichten-auswahl.htm) 的 link 时,将加载具有新框架集的新站点。

现在我想使用 JQuery 的 tablesorter,所以我必须在每个框架集中也包含 JQuery。但是我想在我的 start.htm 的第一个框架集中包含一次 JQuery。

但是当我这样做时,JQuery 不存在于父框架集中。

有解决办法吗?非常感谢。

start.htm

//This is the start.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="de">
<title>Test</title>
</head>
<frameset rows="69,*" frameborder="0" framespacing="0" border="0" >
  <frame src="startseiten/top.htm" name="oben" scrolling="no" noresize>
  <frame src="startseiten/bottom-seiten/b-home.htm" name="unten" scrolling="auto" noresize>
  <noframes>
  <body>
  Ihr Browser unterstützt keine Frames. Daher können die Seiten nicht angezeigt werden.
  </body>
  </noframes>
</frameset>
</html>

b-home.htm

//This is the b-home.htm this is another Frameset here i have to include JQuery too.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="de">
<script type="text/javascript" src="../sys/tools/editor/jquery.min.js"></script>
<SCRIPT type="text/javascript" src="../sys/tools/editor/jquery.tablesorter.min.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../sys/tools/editor/jquery.tablesorter.widgets.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../sys/tools/js/tablesortPlugin.js"></SCRIPT>
</head> 
<title>unten</title>
</head>
<frameset rows="24,*" border="0" framespacing="0" frameborder="0" >
    <frameset cols="300,*" border="0" framespacing="0" frameborder="0" >
        <frame src="../sichtenanzeige/t-home.htm"  name="sicht-anzeige" scrolling="NO" noresize>    
        <frame src="../menueleiste.htm" name="menueleiste" scrolling="NO" noresize>
    </frameset>
    <frameset cols="300,*" framespacing="5">
        <frame src="../sichten-auswahl.htm" name="menu" scrolling="NO")>    
        <frame src="../main.htm" name="mainmk" scrolling="auto">
    </frameset>
</frameset>
</html>

sichten-auswahl.htm

//This is the sichten-auswahl.htm here is the navigation for the first page. With this links i load a new frameset in the frame with the name "unten" Sichtenauswahl 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../redak_support/sys/layout/m-screen.css">
<title>Sichtenauswahl</title>
</head>
<body id="sichtenauswahl">
<p><a href = "bottom-seiten/b-customer.htm">Kunde</a></p><hr>
<p><a href = "bottom-seiten/b-main.htm">Hauptsicht</a></p><hr>
</body>
</html>

b-customer.htm

//b-customer.htm this is another Frameset here i have to include JQuery too.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="de">
<script type="text/javascript" src="../sys/tools/editor/jquery.min.js"></script>
<SCRIPT type="text/javascript" src="../sys/tools/editor/jquery.tablesorter.min.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../sys/tools/editor/jquery.tablesorter.widgets.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../sys/tools/js/tablesortPlugin.js"></SCRIPT>
</head> 
<frameset rows="24,*" border="0" framespacing="0" frameborder="0" >
    <frameset cols="300,*" border="0" framespacing="0" frameborder="0" >
        <frame src="../sichtenanzeige/t-kunde.htm"  name="sicht-anzeige" scrolling="NO" noresize>       
        <frame src="../menueleiste.htm" name="menueleiste" scrolling="NO" noresize>
    </frameset>
    <frameset cols="300,*" framespacing="5">
        <frame src="../js-kunde.htm" name="menu" scrolling="auto">      
        <frame src="../../umsetzung/sicht-kunde.htm" name="mainmk" scrolling="auto">
    </frameset>
</frameset>
</html>

tablesortPlugin.js

//tablesortPlugin.js this is the javascript which set for all tables the tablesorterPlugin

$(document).ready(function () {
    var frame = $('frame');
    frame.load(function () {
        var doc =  $(frame[3].contentWindow.document);
        $('table',doc).tablesorter();
    }); 
});

如果您绝对必须使用此嵌套框架集解决方案 - 换句话说,您根本不允许更改它,那么我建议您在每个框架中链接到相同的 jquery 源文件最佳方法。

它将在第一次加载时由浏览器缓存,不会引入进一步的 http 开销。

有一些第 3 方插件(如 frameready.js)声称可以提供您想要的东西,但它们都已不在 support/development 范围内,所以我不能推荐它们。

但是,我肯定会建议重构 HTML 以不使用框架集并使用现代前端范例。