php中使用frameset框架局部刷新问题,当我操纵右边主页时怎么即使刷新左边菜单栏?

解决方案 »

  1.   

    使用target修改或使用js修改即可
    index.html<html>
    <head>
    <title>综合示例</title>
    </head>
    <frameset cols="25%,*">
    <frame src="menu.html" scrolling="no" name="Left">
    <frame src="page1.html" scrolling="auto" name="Main">
    <noframes>
    <body>
    <p>对不起,您的浏览器不支持“框架”!</p>
    </body>
    </noframes>
    </frameset>
    </html>
    menu.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
      <title> menu </title>
      <script type="text/javascript">
      function show(){
        parent.Main.location.href="page2.html";
      }
      </script>
     </head> <body>
    menu
    <a href="page1.html" target="Main">page1</a>
    <a href="page2.html" target="Main">page2</a>
    <a href="#" onclick="show()">page2 js刷新</a> </body>
    </html>
    page1.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
      <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
      <title> page1 </title>
     </head> <body>
    page1 </body>
    </html>
    page2.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html;charset=utf-8">
      <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
      <title> page2 </title>
     </head> <body>
    page2 </body>
    </html>