The page at the starting point transmits the value js. If you have time to study it
The Code is as follows:
Script
Function ChangeParam (name, value ){
Var url = window. location. href;
Var newUrl = "";
Var reg = new RegExp ("(^ |)" + name + "= ([^ &] *) (| $ )");
Var tmp = name + "=" + value;
If (url. match (reg )! = Null ){
NewUrl = url. replace (eval (reg), tmp );
}
Else {
If (url. match ("[\?] ")){
NewUrl = url + "&" + tmp;
}
Else {
NewUrl = url + "? "+ Tmp;
}
}
// If the category is changed, it starts from page 1st
If (name! = "PageIndex "){
Reg = new RegExp ("(^ |) PageIndex = ([^ &] *) (| $ )");
Tmp = "PageIndex = 1 ";
If (newUrl. match (reg )! = Null ){
NewUrl = newUrl. replace (eval (reg), tmp );
}
}
Location. href = newUrl;
}
Function QueryMonthTicket ()
{
If ($ ("selectM ")! = Null & $ ("selectY ")! = Null)
{
Var month = $ ("selectY"). value + $ ("selectM"). value;
ChangeParam ("Month", month );
}
}
Function GoPage ()
{
Var page = $ ("txtPage"). value. trim ();
If (page. length = 0 ){
Alert ("Enter the page number ");
Return false;
};
Var strNum = '000000 ';
Var isNum = true;
For (var I = 0; I Var c = page. charAt (I );
If (strNum. indexOf (c) <0 ){
IsNum = false;
Break;
};
};
If (isNum ){
If (parseInt (page)> parseInt (initTotalPage )){
Alert ("the number of pages you entered exceeds the total number of pages. Please try again! ");
Return false;
};
ChangeParam ("PageIndex", page );
} Else alert ('the information you entered is incorrect. Please try again! ');
}
Function GoEnter (evt ){
Evt = evt | window. event;
If (evt & evt. keyCode = 13) return GoPage ();
};
Script