This should work;
document.getElementById('content2').src = "url";
(Also you have mismatched IDs for the frame and getElementById
call)
For a FRAME
, you need a FRAMESET
which precludes the use of a BODY
, so;
<frameset rows="50%,*" onload="LoadPage();">
<frame id="content2"></frame>
.....
Update:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<script type="text/javascript">
function LoadPage(){
document.getElementById('content1').src = "http://www.google.com";
document.getElementById('content2').src = "http://www.bing.com";
}
</script>
<title></title>
</head>
<frameset rows="50%,*" onload="LoadPage();">
<frame src="#" id="content1">
<frame src="#" id="content2">
</frameset>
</html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…