• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

有关页面显示与处理的一些技术和经验_html

html 搞代码 7年前 (2018-06-15) 164次浏览 已收录 0个评论

  1.有关页面框架。

  在主页面设置几个框架页面,

<frameset rows=”64,*,70%”>
  <frame name=”header” scrolling=”no” noresize target=”main” src=”title.htm”>
  <frame name=”main” scrolling=”auto” noresize src=”search.htm”>
  <frame name=”main1″ src=”bottem.htm”>
  <noframes>
  <body>

  然后在请求页面中用如下:

  <form method=”GET” action=”list.asp” target=”main1″>  //这种的处理有时与浏览器有关。当有几层的framset时他们之间并没有哪种层次关性,这里对名的应用不像在页面中那样有层次关系,就像页面中的id一样引用。

  就可以把请求的结果页面放到相关的frame中,就不用更新请求的页面。

http://www.gaodaima.com/32916.html有关页面显示与处理的一些技术和经验_html

  2。出于显示或美观的需要,有时需要框架能够动态的改变。 可以通过该改变外框架的设定来实现。可见如下实例:

  首先在主框架中的代码:

<FRAMESET border=0 cols=166,*    //设置宽度
frameBorder=0 frameSpacing=0 name=content>     //设置名为content的frame
<FRAME marginHeight=0 marginWidth=0
name=BoardMenu noResize scrolling=no     //这样可以确保隐藏后不再占有空间
src=”12.html”>
<FRAME
marginHeight=0 marginWidth=0 name=BoardMain noResize
src=”Right.jsp”></FRAMESET><noframes></noframes>

  在对应的12.html中的如下:

<style type=”text/css“>
.np {COLOR: black; CURSOR: hand; FONT-FAMILY: webdings; FONT-SIZE: 18px}
</style>
    <script language=”JavaScript“>
function switchSysBar(){
 if (switchPoint.innerText==3){  //根据span的innerText属性值来判断。
  switchPoint.innerText=4
  document.all(“mnuList”).style.display=”none”   //当要隐藏时,id属性为mnulist的标记不显示
  top.content.cols=”16,*” //改变外框架(名为content)的框架划分,从而达到隐藏的效果
 }
 else{        //是上面过程的逆过程
  switchPoint.innerText=3
  document.all(“mnuList”).style.display=””
  top.content.cols=”166,*”
 }
}
</script>
<body leftMargin=”10″ topMargin=”0″ marginwidth=”10″ marginheight=”0″>
<table align=”center” border=”0″ cellPadding=”0″ cellSpacing=”0″ height=”100%” width=”162″>
  <tr>
    <td bgColor=”#FFFAF8″ id=”mnuList”>//定义要隐藏的区域
       <img src=”http://www.webjx.com/htmldata/2006-03-03/image/catalog.jpg&#8221; width=”120″ height=”88″/> reee
 </td>
    <td background=”image/menuVertical.gif” bgColor=”#ffffff” width=”16″>
    <table border=”0″ cellPadding=”0″ cellSpacing=”0″>
      <tr>
        <td align=”middle” vAlign=”center”>
        <span class=”np” id=”switchPoint” title=”打开/关闭导航”>
        3</span></td>        //事件源
      </tr>
    </table>
    </td>
  </tr>
</table>

  本程序采用对一些tag符定义id,然后利用对应的属性来改变属性值,从而达到某些显示效果。

  3.特殊字符的处理

  在xml中有一些特殊字符(例如:<,>,&,’,’),通常是不能出现在xml文档中,否则该文档就是不具备有效性的原则。

  当用Msxml.DOMDocument处理时,它会自动把相关的特殊字符按规则转换成相应的字符,不必考虑特殊情况。

  对于其他的非xml文档,常见的html文档中通常需要处理特殊字符,以在javaScript的处理为例,

  见如下:

<SCRIPT language=”javascript”>
function  viladiate()
{
var s=content.value;   //获取某个表单域
//处理如下四种字符
s = s.replace(//</g, “&lt”);
s = s.replace(//>/g, “&gt”);
s = s.replace(//”/g, “&quot”);
s = s.replace(//’/g, “&apos”);
s = s.replace(//&/g, “&amp”);
   content.value=s;  //对内容重置
}
</SCRIPT>

  通常采用onmouseover+隐藏表单域或提交后验证替换(例:<input name=”submit” type=”submit” value=”提 交”/>),当然可以采用其他的办法来处理。

  4.在xml用dom来处理是要注意

  1)doc.documentElement获取根节点的。

  2) Proot=doc.documentElement.childNodes.item(0);获取根节点的子节点。

  在插入时时在获得的相关的节点下插入。要注意层次结构。

欢迎大家阅读《有关页面显示与处理的一些技术和经验_html》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:有关页面显示与处理的一些技术和经验_html

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址