1
编写页面:
<input type="button" value="按价格" name="score" id="bypic" onclick="bypicord()">
<input type="hidden" value="desc" id="ordercon">
2
编写js:
<script type="text/javascript">
function bypicord(){
var reorder = $("#ordercon").val()
if("desc" == reorder){
$("#ordercon").val("asc")
var url = "<%=path
%>/product/listproduct.action?uid="孝猜+${sessionScope.user.id}+"&sort=price&ten=Y&FROMBUS=Y&order=asc"
gotoquery(url)
//window.location.href =gotoquery('url')
}else {
$("#ordercon").val("desc")
reorder = "desc"
var url = "<%=path
%>/product/listproduct.action?uid="+${sessionScope.user.id}+"&sort=price&ten=Y&FROMBUS=Y&order=desc"
gotoquery(url)
}
}
</script>
其中的:$("#ordercon").val("asc")就是给烂薯id为ordercon的元素赋值
3
效果如下:
END
注意事项
其中的:$("#ordercon").val("asc")就是给id为ordercon的元素巧历型赋值
http://jingyan.baidu.com/article/9989c746058347f648ecfed8.html
<div id="content"大和></div><input id="input" />
<script>
$("#content").text("填察备写值")
$("#input").val("填滚没盯写值")
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)