<a href="${pageContext.request.contextPath }/commitreportchannel.do?ano=${userareano }" 
onclick="window.parent.left.location.reload()"
target="main">从网上看了说onclick先执行
但是我想让href 里边的内容先执行,再执行onclick事件
求教如何实现,谢谢

解决方案 »

  1.   

    都放onClick事件里:
    <a href="#"  
    onclick="location.href='${pageContext.request.contextPath }/commitreportchannel.do?ano=${userareano ';window.parent.left.location.reload()"
    target="main">
    这样行不?
      

  2.   

    href跳转就是到其它页面了,你可以把onclick要做的事情放到跳转后的页面去做
      

  3.   

    我写错了
    <a href="#"   
    onclick="window.parent.left.location.reload();location.href='${pageContext.request.contextPath }/commitreportchannel.do?ano=${userareano ';"
    target="main">
      

  4.   

    放到下一个页面可以解决,但是刷新太频繁了
    <body onload="window.parent.left.location.reload()">