给某个DIV容器赋值js函数,ajax中使用,支持ie和firefox
<script>
function setValueForDiv(id,content)
{
var element = document.getElementById(id);
element.innerHTML = unescape(content);
if(!element.innerHTML)
{
try{
element.innerHTML = unescape(content);
}catch(e){}
}
}
</script>
其中 id为div的id
content:为内容
调用例子:
<div id="title"> </div>
setValueForDiv(id,content)
<script>
setValueForDiv("title","this is a test");
</script>