jquery触发a标签跳转事件示例代码

时间:2013-07-21    点击:76   
1.写入<a>标签:
<a target="_blank" href="javascript:void(0)" onclick="checkValidate()">水觅微博</a>
2.加入JS:
复制代码 代码如下:

<script type="text/javascript">
function checkValidate(){

if($("#signOut").text()){

window.location.href="<%=basePath%>/jsp/weibo/index.jsp";
}else{

window.location.href="<%=basePath%>index.jsp";
}
}
</script>

3.解释:
$("#signOut").text()为我所需要判断的对应ID的Html元素的值
JS中eval函数的使用示例
JS中prototype关键字的功能介绍及使用示例
原生JS实现表单checkbook获取已选择的值
jquery animate实现鼠标放上去显示离开隐藏效果
jquery封装的对话框简单实现
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved