我想点击这个时"<a href='#' onclick='LPC();'>
",就跳到baidu.com的页面.function LPC()
{
window.open ('http://www.baidu.com', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
}
但IE7报:"缺少对像",什么问题。谢谢.

解决方案 »

  1.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script>
    function LPC()
    {
    window.open ('http://www.baidu.com', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }
    </script>
    </head><body>
    <a href='#' onclick='LPC();'> bbb</a>
    </body>
    </html>
    我把你的代码拷过来。好像没问题嘛。我也是IE7...
      

  2.   

    貌似
    height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no
    不能有空格你把空格去掉试下
      

  3.   

    兄弟:这样最直截了当:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm18.aspx.cs" Inherits="Maticsoft.Web.测试页面.WebForm18" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>我要去百度</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <a href="http://baidu.com">百度一下</a>
        </div>
        </form>
    </body>
    </html>
      

  4.   

    <a href="http://baidu.com" target='blank'>百度一下 </a> 
      

  5.   

    代码是这样的. while(!latpRec.EOF)
    {
        strTopContentHTML +="<a href='#' onclick='LPC();'>" + latpRec("latp_latestfunctionname") + "</a>  ";    latpRec.Next();
    }function LPC()
    {
    window.open ('../uploadfiles/upfile1.asp', 'newwindow', 'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }
    本来我是想在onclick事件中把这个加进去:window.open ('../uploadfiles/upfile1.asp', 'newwindow', 'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    但是程序可能对"和'符号有要求,所以我就想用一个事件去完成它了,但是当我用onclick 事件后,运行时报错,说"缺少对像",那有没有方法在这里直接做一个超链接给它,让它打开一个新的窗口??
      strTopContentHTML +="<a href='#' onclick='window.open('http://baidu.com','newwindow', 
    'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,
    location=no, status=no')'>" + latpRec("latp_latestfunctionname") + "</a>  ";这样好像不行,望高手赐教.谢谢
      

  6.   

    贴代码怎么不贴全呢?latp_latestfunctionname是嘛玩意儿!
    你知道是什么问题造成的吗?是你生成代码的问题,还是使用原有方法的问题。
      

  7.   


    strTopContentHTML +="<a href='#' onclick=\"window.open('http://baidu.com','newwindow', 
    'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,
    location=no, status=no')\">" + latpRec("latp_latestfunctionname") + "</a>  ";
      

  8.   

    latpRec("latp_latestfunctionname")这个是从数据库里读取一个数据.我想是超链接有问题,因为"符号与'符号同时使用时,如果使用不当会报错的.就像这样,就不行了.strTopContentHTML +="<a href='#' onclick='window.open('http://baidu.com','newwindow', 
    'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,
    location=no, status=no')'>" + latpRec("latp_latestfunctionname") + "</a>  ";应该是"符号与'符号使用不当造成的.
      

  9.   

    strTopContentHTML +="<a href='#' onclick=\"window.open('http://baidu.com','newwindow', 
    'height=50, width=400, top=250, 
    left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,
    location=no, status=no')\">" + latpRec('latp_latestfunctionname') + "</a>  ";
    这样试试看
      

  10.   

    latpRec("latp_latestfunctionname")
    你的她是一个函数?如果是函数,这样写也是可以的啊latpRec('latp_latestfunctionname')。既然还有错。那就不知道是哪里的错了。
      

  11.   

    你看下产生的a是不是有问题。我昨天遇到一个问题。一个下载,在window系统没问题,但是发布到服务器之后就有问题(非window)。找了很久才发现问题是<c:set>没有按照标准来写,造成不同系统产生了不同的链接参数。
    所以找到你点的时候的href就可以知道原因了。
      

  12.   

    'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no'
    去掉所有逗号后的空格:
    'height=50,width=400,top=250,left=250,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'
    这个属性不能有任何空格的
      

  13.   

    我之前在开发中也出现过这样的问题,自己的解决办法是:在超链接和js函数中都加个return。你可以试下
    <script>
    function LPC()
    {
    window.open ('http://www.baidu.com', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    return false;
    }
    </script><body>
    <a href='#' onclick='return LPC();'> </a>
    </body>