Function: automatically uploads the 02view.html file under the same directory in 5 seconds.
1) html implementation
<Head>
<Meta http-equiv = "refresh" content = "5366url%02view.html">
</Head>
Advantage: simple
Disadvantage: cannot be used in Struts Tiles
2) javascript implementation
<Script language = "javascript" type = "text/javascript">
SetTimeout ("javascript: location.href='02view.html '", 5000 );
</Script>
Advantage: flexible, can be combined with more other functions
Disadvantage: affected by different browsers
3) combined with the countdown javascript implementation (IE)
<Span id = "totalSecond"> 5 </span>
<Script language = "javascript" type = "text/javascript">
Var second = totalSecond. innerText;
SetInterval ("redirect ()", 1000 );
Function redirect (){
TotalSecond. innerText = -- second;
If (second <0) location.href%'02view.html ';
}
</Script>
Advantage: more user-friendly
Disadvantage: firefox does not support (firefox does not support innerText attributes such as span and div)
3 ') combined with the countdown javascript implementation (firefox)
<Script language = "javascript" type = "text/javascript">
Var second = document. getElementById ('totalsecond'). textContent;
SetInterval ("redirect ()", 1000 );
Function redirect ()
{
Document. getElementById ('totalsecond'). textContent = -- second;
If (second <0) location. href = '02view.html ';
}
</Script>
4) solve the problem that Firefox does not support innerText.
<Span id = "totalSecond"> 5 </span>
<Script language = "javascript" type = "text/javascript">
If (navigator. appName. indexOf ("Explorer")>-1 ){
Document. getElementById ('totalsecond'). innerText = "my text innerText ";
} Else {
Document. getElementById ('totalsecond'). textContent = "my text textContent ";
}
</Script>
5) integration 3) and 3 ')
<Span id = "totalSecond"> 5 </span>
<Script language = "javascript" type = "text/javascript">
Var second = document. getElementById ('totalsecond'). textContent;
If (navigator. appName. indexOf ("Explorer")>-1)
{
Second = document. getElementById ('totalsecond'). innerText;
} Else
{
Second = document. getElementById ('totalsecond'). textContent;
}
SetInterval ("redirect ()", 1000 );
Function redirect ()
{
If (second <0)
{
Location. href = '02view.html ';
} Else
{
If (navigator. appName. indexOf ("Explorer")>-1)
{
Document. getElementById ('totalsecond'). innerText = second --;
} Else
{
Document. getElementById ('totalsecond'). textContent = second --;
}
}
}
</Script>