2014年1月7日星期二

Js jump on the issue

This is

" onclick = "isLogon ()"> Join shopping cart



Why not jump to / jsp / log.jsp? Or the current page ? Solving
------ Solution --------------------------------------- -----
" onclick = "isLogon ()" ; > add to Cart
href should be performed inside the content.
------ Solution ---------------------------------------- ----
<html>
<script type="text/javascript">

</script>
<body>
<input type="button" value="跳转" onclick="window.location.href='http://www.baidu.com'"/>
<a onclick="window.location.href='http://www.baidu.com';void 0" href="#"> 点击这里 </a>
</body>
</html>

------ Solution ------------------------------ --------------
F12 - look there is nothing wrong tips
------ Solution -------- ------------------------------------
brothers look to try


<a href="javascript:void(0);" onclick="isLogon('addAction?pid=<s:property value="#product.pid"/>')">加入购物车</a>

<script type="text/javascript">
function isLogon(path){
var name=document.getElementById("name").value;
if(name==null) //即使设为true 还是一样
window.location.href="/jsp/log.jsp";
}else{
window.location.href=path;
}
</script>

------ For reference only ----------------------------------- ----


What does this mean ?
What I mean is to satisfy the conditions of the method js pages jump on the implementation of the method
condition is not satisfied in respect of the implementation of a href
------ For reference only ----------------------- ----------------
own roof ! ! ! ! !
------ For reference only -------------------------------------- -
has found a way , way upstairs looks feasible
" onclick = "return isLogon ()"> ; join


没有评论:

发表评论