File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
- ageTime = setInterval ( function ( ) {
1
+ //Initialize the Count or Time in sec equals to zero
2
+ var count = 0 ;
3
+
4
+ //Assign SetInterval to a variable
5
+ PageTime = setInterval ( function ( ) {
6
+ //Increament Count on Each Interval Call i.e. Each Second
2
7
count += 1 ;
8
+ //If Time is Greater than 20 sec Load the Timeout Page : Change time as per need
3
9
if ( count === 20 ) {
10
+ //code to clear the interval
4
11
clearInterval ( pageTime ) ;
12
+ //Insert the HTML here which will be painted after timeout is encountered
5
13
document . write ( "Code FOr Page To Be Displayed Here" ) ;
6
14
}
7
15
} , 1000 ) ;
16
+
17
+ //This determines the state of the entire document
8
18
document . onreadystatechange = function ( ) {
19
+ //Here we selected Interactive event to encounter the Timeout
20
+ //Load Time or DOM content loaded time can also be used
9
21
if ( document . readyState === 'interactive' ) {
10
22
clearInterval ( pageTime ) ;
11
23
}
12
24
}
13
25
14
- function reloadIM ( ) {
15
- _gaq . push ( [ '_trackPageview' , '/IMartEvents/Timeout/Refresh' + document . location . pathname ] ) ;
26
+ //Function to reload the page can be call using the HTML inserted by document.write
27
+ //Can be call on an onclick event of a buttom
28
+ function reloadPage ( ) {
16
29
location . reload ( ) ;
17
30
}
You can’t perform that action at this time.
0 commit comments