怎么给Div 的ID赋值,知道的指点下,感激不尽!!!!

来源:百度知道 编辑:UC知道 时间:2024/09/22 19:38:39
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>页面</title>
<link rel="stylesheet" type="text/css" href="comment_css.css">
<script type="text/javascript" src="comment_ajax.js"></script>
<script type="text/javascript" src="comment_index.js"></script>
</head>
<body>
<div id="blog"><span id=blog_loading><img border=0 src=loading.gif></span></div>
</body>
</html>
我想给Div赋值怎么写代码,知道的告诉下,谢谢!!!!
html代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>评论页面</title>
<link rel="stylesheet" type="text/css" href="comment_css.cs

<script type="text/javascript">
var comment_id =xxx;//XXX你要赋予的值
function window.onload() {
ajax('comment.asp?id='+comment_id+'','blog');
}
</script>

你是想在这个画面取得上一个画面的值,然后赋给这个画面的一个DIV是吗?
如果是这样,用window.opener.document.getElementById("ID值")来获取上一个页面存值的对象.
下面是一个简单的例子
a.html
<HTML>
<HEAD>
</HEAD>
<script>
function fun(){
var param = "width = 590px,height=420px,menubar = no,toolbar = no,location = no,directries = no,scrollbars = no,status = no,resizable = no, left= 220, top = 150";
window.open("b.html","",param);
}
</script>
<BODY>
<span id="aa">aaaaaa</span>
<input type="button" value="c" onclick="fun();">
</BODY>
</HTML>

b.html
<HTML>