你好,就用你给的“date=11”这个网址来举例,我写了下面的代码,直接就可以获取date参数的值:
var d = location.search.substr(location.search.indexOf('date=')).replace("date=","")如果需要解释,请追问。很高兴为你解答。
<asp:DropDownList id="DropDownList 1 " runat="server" AutoPostBack="true" onselectedindexchanged="DropDownList1 _SelectedIndexChanged" ></asp:DropDownList><asp:DropDownList id="DropDownList 2 " runat="server" ></asp:DropDownList>
直接用DropDownList的事件(DropDownList1_SelectedIndexChanged,在属性里)
然后在服务器端写代码 判断DropDownList1的值,然后再决定DropDownList2显示隐藏
(DropDownList2.Visible=true/false)
<script>var arr=[{"id":"28","url":"a.com","name":"A-站"},{"id":"22","url":"a.com","name":"B-站"}]
window.onload=function(){
document.getElementById("id").onchange=function(){
var v=this.value
var a=arr.filter(function(o){return o.id==v})[0]
document.getElementById("name").innerHTML="ID:"+a.id+"<br>URL:"+a.url+"<br>NAME:"+a.name
}
}
</script>
<select name="id" id="id">
<option value="">选择线路</option>
<option value="28">线路1</option>
<option value="22">线路2</option>
</select>
<div id=name></div>