<html>
<head>
<script language="javascript">
var xmlHttp = false;
var e;
function CreateDateSelect()
{
var html = [];
for(var year=2008;year<=2008;year++)
{
for(var month=1;month<13;month++)
{
for(var day=1;day<32;day++)
{
html[html.length] = "<option value=\""+year+"\-"+month+"\-"+day+"\">"+year+"年"+month+"月"+day+"日"+"</option>";
}
}
}
document.getElementById("dateselect").innerHTML = "<select name=\"dateselect\" id=\"dateselect\" onchange=\"CallServer(this);\">"+html.join("")+"</select>";
}
function getXMLHTTPObj()
{
var C = null;
try
{
C = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
C= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(sc)
{
C=null;
}
}
if(!C && typeof XMLHttpRequest != "undefined")
{
C = new XMLHttpRequest();
}
return C;
}
function CallServer(e)
{
try
{
if(xmlHttp && xmlHttp.readyState != 0)
{
xmlHttp.abort();
}
xmlHttp = getXMLHTTPObj();
if(xmlHttp)
{
//alert(e);
var dateSelect = e.options[e.selectedIndex].value;
document.getElementById("date").innerHTML= dateSelect+"开放式基金净值";
var url="http://www.cc168.com.cn/service/FundNetValue.jsp?newEndDate="+dateSelect;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
else
{
document.getElementById("flag").innerHTML = "XMLHTTP Create Fail";
}
}
catch(e)
{
document.getElementById("flag").innerHTML="select fail"+e;
}
}
function updatePage()
{
try
{
if(xmlHttp.readyState == 1)
{
document.getElementById("flag").innerHTML = "Loading object";
}
if(xmlHttp.readyState == 2)
{
document.getElementById("flag").innerHTML="Loading object finish";
}
if(xmlHttp.readyState == 3)
{
document.getElementById("flag").innerHTML="DOWNLOADING data...";
}
if(xmlHttp.readyState == 4)
{
document.getElementById("flag").innerHTML=xmlHttp.responseText;
}
}
catch(e)
{
}
}
</script>
</head>
<body onload="CreateDateSelect();">
<form>
<div>请选择日期</div>
<div>
<div id="dateSelect" align="left"></div>
<div id="flag" align="right"></div>
</div>
<div id="date"></div>
<div id="outgroup">
<div id="group1"></div>
<div id="group2"></div>
<div id="group3"></div>
<div id="group4"></div>
</div>
</form>
</body>
</html>