• 5549阅读
  • 4回复

【求助】如何用代码删除一个标记呢? [复制链接]

上一主题 下一主题
离线fanyu
 
只看楼主 倒序阅读 楼主  发表于: 2005-09-05
这是代码
  1. <A href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.2" target=_self><IMG height=16 alt=隐藏详细信息待办事宜 src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%9B%BE%E6%A0%87.gif?OpenImageResource&ImgIndex=1" width=16 border=0></A><IMG height=1 alt="" src="/icons/ecblank.gif" width=20 border=0><FONT color=#000000><A href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.2" target=_self>待办事宜</A></FONT>


其中的
  1. <IMG height=1 alt="" src="/icons/ecblank.gif" width=20 border=0>
显然是不需要的多余代码,由于上述的代码不是手写的,是自动生成的,所以没有办法修改原代码,只能用额外的代码来把它删除,大家看看有没有什么好的办法?
离线XChinux

只看该作者 1楼 发表于: 2005-09-05
可以在它外面定义一个form,然后用Javascript把它删除了

<html>
<head><title></title>
</head>
<body>
<script language="javascript">
function delimg()
{
     document.myimg.innerHTML = "";
}
</script>
<form name="myimg">
     <img name="img1" id="img1" src="logo.gif">
</form>
<br>
<a href="javascript:delimg()">删除</a>
</body>
</html>
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线fanyu
只看该作者 2楼 发表于: 2005-09-05
我把它放到项目生成的静态页里可是有问题,找不到对象了
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="/demo_left.css" type="text/css"><base target="TaskFSMain">
<script language="JavaScript" type="text/javascript">
<!--
document._domino_target = "TaskFSMain";
function _doClick(v, o, t) {
var url="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&Click=" + v;
if (o.href != null)
  o.href = url;
else {
  if (t == null)
    t = document._domino_target;
  window.open(url, t);
}

}

// -->
</script>
<script language="javascript">
     function delimg()
{
  //document.MyDelete.innerHTML = "";
}

</script>
</head>
<body text="#000000" bgcolor="#FFFFFF">
<form action="" name="MyDelete"><div id="Layer2" >
<table width="164" border="0" cellspacing="0" cellpadding="0" height=100%>
  <tr height="17">
    <td height="17"><img src="daiban" width="185" height="17"></td>
  </tr>
  <tr>
    <td>
    <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" bgcolor="#FFFFFF">
      <tr>
        <td height="292">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
          <tr>
            <td width="6"> </td>
            <td valign="top" align="left" width="159">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" height="905%">
              <tr>
                <td align="center" valign="top" height="65">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <tr>
                    <td width="14%" rowspan="2"> </td>
                    <td width="84%"> </td>
                  </tr>
                  <tr>
                    <td width="84%"></td>
                  </tr>
                </table>
                </td>
              </tr>
              <tr>
                <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
                  <tr>
                    <td width="12%"> </td>
                    <td width="88%">
                 </td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
            </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</div>
<div id="Layer1" style="position:absolute; width:136px; height:21px; z-index:3; left: 25px; top: 55px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center"><font size="2">Fanyu,上午好</font></div></td>
  </tr>
  <tr>
    <td><div align="center"><font size="2">2005年9月5日 星期一</font></div></td>
  </tr>
</table>
</div>
<div id="Layer2" style="position:absolute; width:170px; height:370px; z-index:5; left: 20; top: 120">
<table width="100%" border="0" cellspacing="0">
<tr><td width="100%" align="left" valign="top"><a href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.2" target="_self"><img border="0" height="16" width="16" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%9B%BE%E6%A0%87.gif?OpenImageResource&ImgIndex=1" alt="隐藏详细信息待办事宜"></a><img border="0" src="/icons/ecblank.gif" height="1" width="20" alt=""><font color="#000000"><a href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.2" target="_self">待办事宜</a></font></td></tr>

<tr><td width="100%" align="left" valign="top"><img border="0" height="1" width="19" src="/icons/ecblank.gif" alt=""><img border="0" height="16" width="16" src="/icons/ecblank.gif" alt=""><img border="0" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%8F%B6%E5%AD%90%E8%8A%82%E7%82%B9.gif?OpenImageResource" height="16" width="16" alt=""><img border="0" src="/icons/ecblank.gif" height="16" width="4" alt=""><font color="#000000"><a href="/mail/fanyu.nsf/$$ViewTemplate%20for%20MyTask%20by%20Date?OpenForm" target="TaskFSMain">按时间</a></font></td></tr>

<tr><td width="100%" align="left" valign="top"><img border="0" height="1" width="19" src="/icons/ecblank.gif" alt=""><img border="0" height="16" width="16" src="/icons/ecblank.gif" alt=""><img border="0" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%8F%B6%E5%AD%90%E8%8A%82%E7%82%B9.gif?OpenImageResource" height="16" width="16" alt=""><img border="0" src="/icons/ecblank.gif" height="16" width="4" alt=""><font color="#000000"><a href="/mail/fanyu.nsf/$$ViewTemplate%20for%20MyTask%20by%20kind?OpenForm" target="TaskFSMain">按分类</a></font></td></tr>

<tr><td width="100%" align="left" valign="top"><a href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.1" target="_self"><img border="0" height="16" width="16" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%9B%BE%E6%A0%87.gif?OpenImageResource&ImgIndex=1" alt="隐藏详细信息已办事宜"></a><img border="0" src="/icons/ecblank.gif" height="1" width="20" alt=""><font color="#000000"><a href="/mail/fanyu.nsf/TaskFSLeft?OpenPage&BaseTarget=TaskFSMain&ExpandOutline=1.1" target="_self">已办事宜</a></font></td></tr>

<tr><td width="100%" align="left" valign="top"><img border="0" height="1" width="19" src="/icons/ecblank.gif" alt=""><img border="0" height="16" width="16" src="/icons/ecblank.gif" alt=""><img border="0" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%8F%B6%E5%AD%90%E8%8A%82%E7%82%B9.gif?OpenImageResource" height="16" width="16" alt=""><img border="0" src="/icons/ecblank.gif" height="16" width="4" alt=""><font color="#000000">按时间</font></td></tr>

<tr><td width="100%" align="left" valign="top"><img border="0" height="1" width="19" src="/icons/ecblank.gif" alt=""><img border="0" height="16" width="16" src="/icons/ecblank.gif" alt=""><img border="0" src="/mail/fanyu.nsf/%E5%A4%A7%E7%BA%B2%E5%8F%B6%E5%AD%90%E8%8A%82%E7%82%B9.gif?OpenImageResource" height="16" width="16" alt=""><img border="0" src="/icons/ecblank.gif" height="16" width="4" alt=""><font color="#000000">按分类</font></td></tr>
</table>
<div>




<p></form>
<br>
<a href="javascript:delimg()">删除</a>
</body>
</html>
离线fanyu
只看该作者 3楼 发表于: 2005-09-05
其实只要改变一个<IMG height=1 alt="" src="/icons/ecblank.gif" width=20 border=0>的宽度就可以了,如何改变呢?
离线XChinux

只看该作者 4楼 发表于: 2005-09-06
我看的javascript里说的是这个改变不了除src之他的其它属性的。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
快速回复
限100 字节
 
上一个 下一个