An ASP's paging display function simulated with VBS _VBS

Source: Internet
Author: User
Just finished 1 projects, idle boredom, want to change their own homepage, but no ASP permissions, so whim, with a VBS simulation of a picture paging display function! Due to the writing is suitable for their use of functions, it is inevitable that many places are not very perfect! Also ask you to pass by some advice, if a friend just want to find similar functions, perhaps to help, in addition, I wish the forum every friend Happy New Year!
Copy Code code as follows:

<script language=vbs>
Function Showindexpage ()
Js=1
Webpath=window.location
Do until left (webpath,1) = "#" or Js=len (window.location)
Js=js+1
Webpath=right (WINDOW.LOCATION,JS)

Loop
If Js=len (window.location) then showindexpage=1 else Showindexpage=replace (Webpath, "#", "")
End Function

qz= "" ' need to display the image file prefix
hz= ". gif" ' needs to display the image file suffix
Themax=98 ' Maximum display image number
Theskip=5 ' How many images are displayed per line
Thepage=20 ' How many images are displayed per page

Theindex=int (Themax/thepage)
If Themax MoD thepage <> 0 then theindex=theindex+1

For I=1 to Theindex
showindex= "<a href=#" &i& "Onclick=window.location.reload () >" & "[" &i& "]" & "</a> "
document.write Showindex
Next
document.write "<br><br>
If Thepage=0 then Thepage=themax
For I=1 to Thepage
Thenum=i+thepage* (Showindexpage ()-1)
If Thenum>themax then EXIT for
If Thenum<10 Then
temp= "</img> "
else if thenum<100 then
temp= "</img>"
Else
temp= "</img>"
End If
End If
document.write Temp
If theskip<>0 then if I mod theskip = 0 Then document.write "<br>"
Next

document.write "For I=1 to Theindex
showindex= "<a href=#" &i& "Onclick=window.location.reload () >" & "[" &i& "]" & "</a> "
document.write Showindex
Next
</script>

<ptml> <pead> <title> automatic Refresh Auto-page test [zozo98]</title> </pead> <body> <script Langua Ge=vbs> Function showindexpage () Js=1 webpath=window.location do Until left (webpath,1) = " # "or Js=len (window.location) js=js+1 webpath=right (WINDOW.LOCATION,JS) L OOP if Js=len (window.location) then showindexpage=1 else Showindexpage=replace (Webpath, "#", "") End Function Q z= "" ' need to display the image file prefix hz= ". gif" ' need to display the image file suffix themax=98 ' Maximum display image number Theskip=5 ' show how many graphs per line Image number Thepage=20 ' How many images per page theindex=int (themax/thepage) if Themax mod thepage <> 0 then Theindex=theinde X+1 for I=1 to Theindex showindex= "" & "[&i&"] "&" "Document.Write Showindex next DOCUMENT.WR Ite "<pr>" if Thepage=0 then Thepage=themax for I=1 to Thepage thenum=i+thepage* (Showindexpage ()-1) I F Thenum>themax ThenEXIT for if Thenum<10 then temp= "" Else if Thenum<100 then temp= "" Els E temp= "" End If End If document.write temp if theskip<>0 then if I mod Theski P = 0 Then document.write "" Next document.write "<pr>" for I=1 to Theindex showindex= "" & "[" &AMP;I&A MP; "]" & "" Document.Write Showindex next </script> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Other:
Get the contents behind the # can be used

Replace (Window.location.hash, "#", "")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.