图片改成绝对路径试试,我这边用绝对路径测试可以正常显示,能显示之后再调试相对路径
解决方案 »
- javascript如何动态在table中加tr和td啊
- js效果与ajax有冲突。。。走不动
- 请教:Firefox下修改Function对象的内容
- jquery 怎样取得html,load后的对象?
- javascript怎样最小化ie?
- 问一个读取xml,显示节点的问题
- 选择省在市的选择框中相应的市出现,那现在我知道省的id和市id那怎么在选择框中出现省和市的名字呀谢谢!
- 用JAVASCRIPT如何将<SELECT>中的所有OPTIONS选项显示出来
- ?让一个texfield根据情况动态地显示或不显示,js中如何写?
- JavaScript选择题问题
- 急!!!S中怎么让document.createElement("select");创建的列表框是DropDownList 而不是listbox呢?(,在线等,谢谢.)
- 让IE在直接请求js文件时在网页上显示javscript源代码,像ff一样
<p id=mp></p>
<script type="text/javascript">
var text = '987',text1='page.987',text2='http://www.csdn.net/Images/logo_csdn.gif';
var cell =document.createElement("td");
cell.setAttribute("style","cursor:pointer" );
cell.setAttribute("height","250px" );
cell.setAttribute("valign","top" );
var t=document.createElement("table");
t.setAttribute("width","218");
t.setAttribute("border","0");
t.setAttribute("cellpadding","0");
t.setAttribute("cellspacing","0");
t.setAttribute("onmouseover",function(){this.style.backgroundColor="#CBE83E"});
t.setAttribute("onmouseout",function(){this.style.backgroundColor="#FFFFFF"});
var row=document.createElement("tr")
var cell1 =document.createElement("td");
var a=document.createElement("a");
a.setAttribute("href","show?id="+text);
a.setAttribute("target","_blank");
var img1 =document.createElement("img");
img1.setAttribute("src",text2);
a.appendChild(img1);
cell1.appendChild(a);//
row.appendChild(cell1);
t.appendChild(row);//
var row1=document.createElement("tr")
var cell2 =document.createElement("td");
cell2.setAttribute("height","60");
cell2.setAttribute("width","100%");
cell2.setAttribute("align","right");
cell2.setAttribute("class","photoTitle");
var divc =document.createElement("div"); //创建一个DIV一个节点
var tableNode=document.createTextNode(text1); //创建一个文本节点
var a1=document.createElement("a")
a1.setAttribute("href","show?id"+text);
a1.setAttribute("target","_blank");
var f=document.createElement("font")//创建一个字节点
f.setAttribute("face","Arial");
f.appendChild(tableNode);
a1.appendChild(f);
divc.appendChild(a1);
cell2.appendChild(divc);//把文本赋值给cell
cell2.setAttribute("class","photoTitle");
row1.appendChild(cell2);
t.appendChild(row1);//
cell.appendChild(t);//
alert(text2 +'\n\n'+ cell.outerHTML);
// return cell; document.getElementById('mp').innerHTML = cell.outerHTML;
</script>