Jump to content

code is running but images are not changing


Pawan_Agarwal

Recommended Posts

Javascript CODE:

var m=n=0;

function show_services()
{
m=m+1;
n=m+1;
if(m==6) {m=6;n=1;}
if(m==7) {m=1;n=2;}

str1 = "/images/pic" + m + ".PNG";
str2 = "/images/pic" + n + ".PNG";

document.getElementById('w1').innerHTML = str1;
document.getElementById('w2').innerHTML = str2;

document.getElementById('img1').src = str1;
document.getElementById('img2').src = str2;
}    

var my_str = setInterval(function() {show_services()},1000);

##############################################################################

 

<img id="img1" src="/images/pic1.PNG" style="margin-top:30px" height="100px" width="550px"/><br>
<img id="img2" src="/images/pic2.PNG" style="margin-top:30px" height="100px" width="550px"/><br>
 
<br>
<div id='w1'></div>
<br>
<div id='w2'></div>

##############################################################################

 

the code is working fine, files have been placed at the right place, str1 and str2 are getting correct values and they are updating at the right time..............I run same code on browser and it works fine, but, when I run the same code on website domain, it does work at all, what can be the reason for this ............

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.