var txt = "<a href='javascript:;' onclick='javascript: openwindow('SubView.aspx','newwindow',602,500)'  onMouseMove='seashowtip(this.tips,1,300)' onMouseOut='seashowtip(this.tips,0,300)' tips='"+b+"'><font color=\"#330066\">"+a[i][8]+a[i][3]+"</font></a>";map.addOverlay(new aboutText(point,txt));  
我用javascript定义了一个变量,要打开一个新窗体.上面那样写怎么不对呢.根本弹不出来.总是提示语法错误.
最下面状态栏上显示的是http://localhost/Msg/A.aspx#

解决方案 »

  1.   

    openwindow 改成 window.open
      

  2.   

    var txt = ' <a href="javascript:;" onclick="window.open(\'SubView.aspx\',\'newwindow\',602,500)"  onMouseMove="seashowtip(this.tips,1,300)" onMouseOut="seashowtip(this.tips,0,300)" tips='+b+'> <font color=\"#330066\">'+a[i][8]+a[i][3]+' </font> </a>'; map.addOverlay(new aboutText(point,txt));  
      

  3.   

    谢谢楼上,我的openwindow 是一个函数
      function openwindow(url,name,iWidth,iHeight)
        {
         var url;                                 //转向网页的地址;
         var name;                           //网页名称,可为空;
         var iWidth;                          //弹出窗口的宽度;
         var iHeight;                        //弹出窗口的高度;
         var iTop = (window.screen.availHeight-30-iHeight)/2;       //获得窗口的垂直位置;
         var iLeft = (window.screen.availWidth-10-iWidth)/2;           //获得窗口的水平位置;
         window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
       }   
      

  4.   

    <!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>
        <title>无标题页</title>    <script src="../脚本/jquery-1.3.2.min.js" type="text/javascript"></script>
        <script type="text/javascript">
        $(function(){
          $("#Button1").bind("click",function(){
          
          window.open("HTMLPage2.htm","222","width:300px;height:200px","");
          })
        })
        </script>
    </head>
    <body>
        <input id="Button1" type="button" value="click" />
    </body>
    </html>
      

  5.   

    我不是Button,我是一个层,加载到地图上,
    function aboutText(point,txt)
         {  
          //this.bounds_ = bounds;
          this.point_ = point;
          this.txt_ = txt;      
         }然后我定义了一个var txt = " <a href='javascript:;' onclick='javascript: openwindow('SubView.aspx','newwindow',602,500)'  onMouseMove='seashowtip(this.tips,1,300)' onMouseOut='seashowtip(this.tips,0,300)' tips='"+b+"'> <font color=\"#330066\">"+a[i][8]+a[i][3]+" </font> </a>"; 
    然后加载到地图
    map.addOverlay(new aboutText(point,txt));  不能用BUTTON
      

  6.   

    window.open("新开窗口的URL","新开窗口的句柄","定义新开窗口的各项属性");
      

  7.   

    问题在:onclick='javascript: openwindow('SubView.aspx','newwindow',602,500)',单引号的问题;
    应该是onclick=\"javascript: openwindow('SubView.aspx','newwindow',602,500)\"
      

  8.   

    var txt = ' <a href="javascript:;" onclick="openwindow(\'SubView.aspx\',\'newwindow\',602,500)"  onMouseMove="seashowtip(this.tips,1,300)" onMouseOut="seashowtip(this.tips,0,300)" tips='+b+'> <font color=\"#330066\">'+a[i][8]+a[i][3]+' </font> </a>'; map.addOverlay(new aboutText(point,txt));  Try.....
      

  9.   

    href里面是什么意思啊,不专业面直接用#就好了。。再就是你的“”的问题了这个道理好像与jsp中,innerHtml的用法一样
      

  10.   


    showModalDialog('report.do?method=allControl','','dialogWidth:580px;dialogHeight:360px;help:no;scroll:yes;status:no');
      

  11.   


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    果然是这个问题,解决了,但是有一个我传递了一个参数,怎么又提示传递不过去呢
     var txt = "<a href='javascript:;' onclick=\"javascript: openwindow("SubView.aspx?sitenoname="+escape(a[i][3]),'newwindow',602,500)\" onMouseMove='seashowtip(this.tips,1,300)' onMouseOut='seashowtip(this.tips,0,300)' tips='"+b+"'><font color=\"#330066\">"+a[i][8]+a[i][3]+"</font></a>";
                     
      

  12.   

    谢谢大家,问题解决了.
    var txt = "<a href='javascript:;' onclick=\"javascript: openwindow('SubView.aspx?sitenoname="+escape(a[i][3])+"','newwindow',602,500)\" onMouseMove='seashowtip(this.tips,1,300)' onMouseOut='seashowtip(this.tips,0,300)' tips='"+b+"'><font color=\"#330066\">"+a[i][8]+a[i][3]+"</font></a>";
      

  13.   

    openwindow(escape("SubView.aspx?sitenoname="+a[i][3]),...)