L
lukaszmn
Hi, I cannot figure out why everything from line "var elem =
doc.getElementsByName('keywords')" in x.js is not executed. I want to
set value of <input name=keywords ...> which is in a.html after page
is loaded.
------------------ search.html --------------------
<html>
<head>
<title>Search</title>
<script src="x.js"/>
</head>
<frameset rows="*" onload="load()">
<frame src="search-1.html"/>
</frameset>
</html>
------------------- search-1.html -------------------------
<html>
<head>
<title>Search</title>
</head>
<body>
<iframe src="a.html" height="600" width="600" id="frameSearch">
</iframe>
</body>
</html>
----------------- a.html --------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MLdonkey: Web Interface</title>
</head>
<body>
<form action="submit">
<input type=text name=keywords size=40 value="">
</form></html>
----------------------------------- x.js
-------------------------------
function load() {
var frame = frames[1].document.getElementById('frameSearch');
var doc = frame.document;
var elem = doc.getElementsByName('keywords');
alert (elem.length);
}
doc.getElementsByName('keywords')" in x.js is not executed. I want to
set value of <input name=keywords ...> which is in a.html after page
is loaded.
------------------ search.html --------------------
<html>
<head>
<title>Search</title>
<script src="x.js"/>
</head>
<frameset rows="*" onload="load()">
<frame src="search-1.html"/>
</frameset>
</html>
------------------- search-1.html -------------------------
<html>
<head>
<title>Search</title>
</head>
<body>
<iframe src="a.html" height="600" width="600" id="frameSearch">
</iframe>
</body>
</html>
----------------- a.html --------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MLdonkey: Web Interface</title>
</head>
<body>
<form action="submit">
<input type=text name=keywords size=40 value="">
</form></html>
----------------------------------- x.js
-------------------------------
function load() {
var frame = frames[1].document.getElementById('frameSearch');
var doc = frame.document;
var elem = doc.getElementsByName('keywords');
alert (elem.length);
}