【如何在showModalDialog中添加超级链接等】 document.write("<a href='href...'><img src='" + list[i] + "' border=0></a>"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是可以的呀<script>document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");</script>是不是你的list有问题呀 list本身就是一个图片的全名。我想该图片连接到自己本身。document.write("<a herf='"+list[i]+"'">)document.write(list[i])document.write("</a>")我这样写不行。 呵呵。是我写错了。写成HERF了。应该是HREF。还有另外一个问题怎么解决呢。谢谢!对该存有图片名字的数组某个单位进行删除。然后前台显示的时候去掉已经删除的值。也就是可以对某个图片名字删除掉。并重新给数组赋值!谢谢 “对该存有图片名字的数组某个单位进行删除。然后前台显示的时候去掉已经删除的值。”是不是在对话框里加控件,是用button还是checkbox删除,前台显示是指什么 就是在页面上显示啊。首先数组先在页面上显示一次。然后每个单位旁边给个连接或者BUTTON。然后点击后。调用删除该单位的函数。然后把剩下的数组,继续在页面上显示。 documnet.write("<div>")document.write("<a href='"+list[i]+"'">)document.write(list[i])document.write("</a>")document.write("<input type=button value='删除 "+list[i]+"' onclick='del(this.parentNode,"+i+")'>")document.write("</div>")...function del(div,index){ list.splice(index,1); div.removeNode(true);}这样的结构可以吗? 比如数组a[1] a[2] a[3] ,显示在页面上。然后点那个删除按钮后。删除掉一个 比如:点A[2]旁边的删除按钮。然后a[1]不变,a[2]变成a[3],a[3]为空。以后类似这样。可以任意删除任何一个。然后下面的各个数组向上移动。 楼主的1,2两个问题是不是同一件事是不是都在showModalDialog页面里进行操作的上面的代码就是在图片下面放上一个删除按钮,点击后图片和list[i]都删除 恩。就是楼上说的。代码也是在同一个页运行。你能教教我你的函数写的是啥么。给个注释行吗。我看不懂呢。谢谢list.splice(index,1); div.removeNode(true);是什么意思呢。很感谢你 splice从一个数组中移除一个或多个元素,第一个参数是删除的起始号,第二个是删除的个数removeNode是删除html对象本身,true是同时删除他下属的子对象上面的那个this.parentNode就是this(input type=button)的父对象div楼主最好看一下dhtml手册,和jscript手册 前面有些笔误list = [1,2,3,4];for(var i=0;i<list.length;i++){document.write("<div>")document.write("<a href='"+list[i]+"'>")document.write(list[i])document.write("</a>")document.write("<input type=button value='删除 "+list[i]+"' onclick='del(this.parentNode,"+i+")'>")document.write("</div>")}function del(div,index){ list.splice(index,1); div.removeNode(true);}你再试试 JS怎样让整数除以整数等于整数?求助 javascript与xml的问题。 <iframe>在网页上如何显示的内容是平面,一般是凹下去的 卡在一个奇怪的地方,关于表格自动换行的 点击浏览器窗口右上角的“X”关闭窗口时,可不可以自动把父窗口也关了! 有关框架和目录树的问题 超链接弹出一个新窗口,如何取得父窗口的窗口名字? 如何让状态条和标题中的字实现滚动?可以用<MARQUEE>吗? 斑竹,我想到了解决以下我的帖子的最佳方法,一会贴上来 如何在子窗口中删除父窗口中的列表框的所有内容??????????? 一个简单的问题~在线等 神啊,救救我吧,实在搞不定
document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");
document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");
document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");
document.write("<a href='http://dotnet.aspx.cc/'><img src='http://dotnet.aspx.cc/Images/logoSite.gif' border=0></a><br>");
</script>是不是你的list有问题呀
document.write("<a herf='"+list[i]+"'">)
document.write(list[i])
document.write("</a>")
我这样写不行。
也就是可以对某个图片名字删除掉。并重新给数组赋值!谢谢
是不是在对话框里加控件,是用button还是checkbox删除,前台显示是指什么
document.write("<a href='"+list[i]+"'">)
document.write(list[i])
document.write("</a>")
document.write("<input type=button value='删除 "+list[i]+"' onclick='del(this.parentNode,"+i+")'>")
document.write("</div>")
...function del(div,index){
list.splice(index,1);
div.removeNode(true);
}
这样的结构可以吗?
是不是都在showModalDialog页面里进行操作的上面的代码就是在图片下面放上一个删除按钮,点击后图片和list[i]都删除
list.splice(index,1);
div.removeNode(true);是什么意思呢。很感谢你
removeNode是删除html对象本身,true是同时删除他下属的子对象
上面的那个this.parentNode就是this(input type=button)的父对象div楼主最好看一下dhtml手册,和jscript手册
list = [1,2,3,4];
for(var i=0;i<list.length;i++){
document.write("<div>")
document.write("<a href='"+list[i]+"'>")
document.write(list[i])
document.write("</a>")
document.write("<input type=button value='删除 "+list[i]+"' onclick='del(this.parentNode,"+i+")'>")
document.write("</div>")
}function del(div,index){
list.splice(index,1);
div.removeNode(true);
}
你再试试