我看了一下脚本
你要做的就是把脚本转到delphi代码啊!
var xmlHttp;
var lott;
var isEnd = "true";
function checkDataNum() {
if(document.all['startNum'].value == ""
{
alert("还未选择开始期次!"
;
return false;
}else if(document.all['endNum'].value == ""
{
alert("还未选择结束期次!"
;
return false;
}else if (isEnd=="fasle"
{
alert("对不起,您选择的开始期次不能大于结束期次!"
;
return false;
}
}
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"
;
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function showDataNum(lo) {
lott = lo;
var lottery = getLotteryObject(lo);
var lotteryAsJSON = JSON.stringify(lottery);
var url = "/datadeal/tools/CreateDataNum?timeStamp=" + new Date().getTime();
createXMLHttpRequest();
xmlHttp.open("POST", url, true);
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"
;
xmlHttp.send(lotteryAsJSON);
}
function selStartDataNum() {
var startDataNum = document.all['startNum'].options[document.all['startNum'].selectedIndex].text;
var endDataNum = document.all['endNum'].options[document.all['endNum'].selectedIndex].text;
if(endDataNum=="--请选择期号--"
{
var url = "/datadeal/tools/SelDataNum?lotteryid="+ lott +"&datanum="+ startDataNum +"&mode=start&timeStamp=" + new Date().getTime();
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = startNumChange;
xmlHttp.send(null);
}else if (startDataNum>=endDataNum){
isEnd = "fasle";
alert("对不起,您选择的开始期次不能大于结束期次!"
;
}
}
function selEndDataNum() {
var endDataNum = document.all['endNum'].options[document.all['endNum'].selectedIndex].text;
var url = "/datadeal/tools/SelDataNum?lotteryid="+ lott +"&datanum="+ endDataNum +"&mode=end&timeStamp=" + new Date().getTime();
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = endNumChange;
xmlHttp.send(null);
}
function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
parseResults();
}
}
}
function startNumChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
startNumResults();
}
}
}
function endNumChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
endNumResults();
}
}
}
function parseResults() {
// 信息已经成功返回,开始处理信息
var startDataNumField = null;
var endDataNumField = null;
startDataNumField = document.getElementById('startNum');
endDataNumField = document.getElementById('endNum');
//清空option对象
startDataNumField.length=1;
endDataNumField.length=1;
var strDataNum = xmlHttp.responseText;
var dataNums = strDataNum.split("|"
;
for (var i=0;i<dataNums.length;i++){
//循环取出信息
var eachDataNum = dataNums
.split(";"
var dataNum = eachDataNum[0];
var startDate = eachDataNum[1];
// 新建一个OPTION对象
var startfield = document.createElement("option"
var endfield = document.createElement("option"
// 设置OPTION对象的值
startfield.value = dataNum;
endfield.value = dataNum;
// 设置OPTION对象的内容
startfield.innerHTML = dataNum;
endfield.innerHTML = dataNum;
// 添加到球队select对象
startDataNumField.appendChild(startfield);
endDataNumField.appendChild(endfield);
}
}
function startNumResults() {
// 信息已经成功返回,开始处理信息
var endDataNumField = null;
endDataNumField = document.getElementById('endNum');
if(endDataNumField.value==""{
//清空option对象
endDataNumField.length=1;
var strDataNum = xmlHttp.responseText;
var dataNums = strDataNum.split("|"
for (var i=0;i<dataNums.length;i++){
//循环取出信息
var eachDataNum = dataNums.split(";"
var dataNum = eachDataNum[0];
var endDate = eachDataNum[1];
// 新建一个OPTION对象
var endfield = document.createElement("option"
// 设置OPTION对象的值
endfield.value = dataNum;
// 设置OPTION对象的内容
endfield.innerHTML = dataNum;
// 添加到球队select对象
endDataNumField.appendChild(endfield);
}}
}
function endNumResults() {
// 信息已经成功返回,开始处理信息
var startDataNumField = null;
startDataNumField = document.getElementById('startNum');
if(startDataNumField.value==""{
//清空option对象
startDataNumField.length=1;
var strDataNum = xmlHttp.responseText;
var dataNums = strDataNum.split("|"
for (var i=0;i<dataNums.length;i++){
//循环取出信息
var eachDataNum = dataNums.split(";"
var dataNum = eachDataNum[0];
var startDate = eachDataNum[1];
// 新建一个OPTION对象
var startfield = document.createElement("option"
// 设置OPTION对象的值
startfield.value = dataNum;
// 设置OPTION对象的内容
startfield.innerHTML = dataNum;
// 添加到球队select对象
startDataNumField.appendChild(startfield);
}}
}
function getLotteryObject(lo) {
var lotteryid = lo;
return new Lottery(lotteryid);
}
function Lottery(lotteryid) {
this.lotteryid = lotteryid;
}
function SetMyFrameHeight(obj){
var myFrame=obj;
if (document.getElementById)
{
if (myFrame && !window.opera)
{
if (myFrame.contentDocument && myFrame.contentDocument.body.offsetHeight){
myFrame.height = myFrame.contentDocument.body.offsetHeight;
}
else if(myFrame.Document && myFrame.Document.body.scrollHeight){
myFrame.height = myFrame.Document.body.scrollHeight;
}
}
}
}