`
igogogo9
  • 浏览: 247369 次
  • 性别: Icon_minigender_1
  • 来自: 海口市
社区版块
存档分类
最新评论

js小问题

阅读更多
<%@ page contentType="text/html;charset=GBK"%>
<%
request.setCharacterEncoding("GBK");
String id = request.getParameter("id");
String name=request.getParameter("name");
%>
<script>
window.location.href="/cms/website/infoshow.jsp?name=<%=name%>&id=<%=id%>";
</script>
是正确的,我以前能把这个文件的script内容写成:

1、<script>
    window.location.href="/cms/website/infoshow.jsp?name=name&id=id";
    </script>

2、 <script>
    window.location.href="/cms/website/infoshow.jsp?name="+name+"&id="+id;
   </script>
这么简单的js都能搞错,实在是太搞笑了。不过第2个以前用过,可以,但是这次就不行,以前的是这样的:
   <script>
     function orgSave()
     {
        var open_url = "/pubinfo/register/webregsucc.jsp?account=" + ssn+"&password="+bb;
window.open(open_url,'','status=0,directories=0,resizable=0,toolbar=0,location=0,scrollbars=0,width=322,height=200');
location.href="/cms/website/index.jsp";
     }
   </script>
不知道为什么2不行。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics