Just nu i M3-nätverket
Jump to content

Javasciprt med ASP


csone

Recommended Posts

Hejsan

Har problem med ett script i IE 6

Scriptet skall skapa en "progress bar" i asp men funkar inte till 100%

 

Raden som kärvar är

Response.Write "statuspic.width = Math.ceil(" & nPctComplete & " * progBarWidth);" & vbCrlf

 

 

Någon som vet?

//cast

 

<%

Response.Buffer = False

server.scriptTimeout =25000

%>

<div id="ProgBar" style="font-family:Verdana; font-size=9pt;">Progress:<BR>

<TABLE style="color:red;" HEIGHT="16" Border=1><TR><TD BGCOLOR=RED ID=statuspic></TD></TR></TABLE><BR>

</div>

<script language="Javascript">var progBarWidth=250;</script>

<%

iProcessedSoFar = 0

iTotalRecords = 200

strHTML=" <Table width=""80%""><TR><TD Width=""100%"" BGCOLOR=""gray"" align=""CENTER"">Results:<td></tr>"

for i = 0 to iTotalRecords

' next few lines are just a surrogate for whatever your processing function to be timed

strHTML = strHTML & "<tr width=""100%""><td width=""100%"" BGCOLOR=""#FFCC66""> Your results</td></tr>"

iProcessedSoFar = iProcessedSoFar + 1

pctComplete = (iProcessedSoFar / iTotalRecords)

if i mod 8 = 0 then

ShowProgress pctComplete

end if

next

FinishProgress

strHTML=strHTML & "</TABLE>"

Response.write strHTML

Sub ShowProgress(nPctComplete)

Response.Write "<SCR" & "IPT LANGUAGE=""JavaScript"">" & vbCrlf

Response.Write "statuspic.width = Math.ceil(" & nPctComplete & " * progBarWidth);" & vbCrlf

Response.Write "</SCR" & "IPT>"

End Sub

Sub FinishProgress

Response.Write "<SCR" & "IPT LANGUAGE=""JavaScript"">" & vbCrlf

Response.Write "ProgBar.style.visibility ='hidden';" & vbCrLf

Response.Write "</SCR" & "IPT>"

end sub

%>

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...