我有一页jquery 表格。 每一表载数据来自另一页的html。 我正在集装箱的html网页上设定一个全球变量,希望在其表格中查阅。 如何这样做? 我尝试了窗户,窗户。 但没有任何东西可以奏效。 我已附上该守则。 友好帮助。
www.un.org/Depts/DGACM/index_spanish.htm 页: 1
<html>
<head>
<link type="text/css" href="../../css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="Stylesheet" />
<link type="text/css" href="./methodeditor.css" rel="stylesheet" />
<script type="text/javascript" src="../../js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../../js/jquery-ui-1.8.14.custom.min.js"></script>
<script>
$(function() {
$( ".tabs" ).tabs({cache:true});
});
</script>
<script>
var method = " ";
function setmethod(m) {
method = m;
}
function loadtabs(){
method = window.parent.method;
setmethod(method);
$("#oven").load( oven.html );
$("#detectors").load( detectors.html );
$("#inlets").load( inlets.html );
}
</script>
</head>
<body>
<form id="editor" action="method.php" method="POST" >
<div class="editor">
<div class="tabs">
<ul>
<li><a href="#oven">Temperature</a></li>
<li><a href="#detectors">Timing</a></li>
<li><a href="#inlets">Vial and Loop</a></li>
</ul>
<div id="oven" ></div>
<div id="detectors" ></div>
<div id="inlets"> </div>
</div>
<script>
loadtabs();
</script>
</form>
</div>
</body>
</html>
<>strong>oven.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script>
function getvalues() {
file = window.method;
//file = m;
file = "./method/"+file;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", file, false);
xmlhttp.setRequestHeader( Content-Type , text/xml );
xmlhttp.send("");
xmldoc = xmlhttp.responseXML;
etimenode = xmldoc.getElementsByTagName("method")[0].childNodes[1].childNodes[1];
etime = etimenode.textContent;
document.getElementById("etime").value = etime;
}
</script>
</head>
<body>
<input type="checkbox" name="oventemp" value="ON" />Oven Temperature
Equilibrium time <input type="text" id="etime" />
<script>
getvalues();
</script>
</body>
</html>