Error - working in IE and MOzilla but giving error null or not a object:
Guys i am giving you snippet of code , where it is javascript digital clock , It is showing time and working properly but it is giving error in log
Help me out guys ....
Thanks in advance.
Guys i am giving you snippet of code , where it is javascript digital clock , It is showing time and working properly but it is giving error in log
Code:
function adidas(){
theTime=setTimeout('dotime();',1000);
ser_sc = ser_sc+1;
var hr= ser_hr+100 ;
var mn= ser_mn+100 ;
var se= ser_sc+100 ;
if(hr==100){
hr=112;am_pm='am';
}
else if(hr<112){
am_pm='am';
}
else if(hr==112){
am_pm='pm';
}
else if(hr>112){
am_pm='pm';hr=(hr-12);
}
tot=''+hr+mn+se;
document.hr1.src = '/flash_files/digits/dg'+tot.substring(1,2)+'.gif';// HERE IT IS GIVING ERROR
document.hr2.src = '/digits/dg'+tot.substring(2,3)+'.gif';
document.mn1.src = '/digits/dg'+tot.substring(4,5)+'.gif';
document.mn2.src = '/digits/dg'+tot.substring(5,6)+'.gif';
document.se1.src = '/digits/dg'+tot.substring(7,8)+'.gif';
document.se2.src = '/digits/dg'+tot.substring(8,9)+'.gif';
document.ampm.src= '/digits/dg'+am_pm+'.gif';
}
adidas();
Thanks in advance.
Comment