Hi, Div innerHTMl not working in IE6. Code: function toggleVisiblity() { var name1="eg"; var tbl = document.getElementById("chart1");alert(tbl);alert(tbl.style.display); alert(tbl.nodeName); var clink=document.getElementById("chartlink"); if(tbl!=null){ if (tbl.style.display == 'block') { tbl.innerHTML=""; tbl.style.display = 'none'; } else { tbl.innerHTML="<img src=../../temp/"+name1+".png>"; tbl.style.display = 'block'; } } } Code: <div align=left><a id='chartlink' href=# onclick=\"toggleVisiblity()\"><img src=\"../images/chart.gif\" border=0></a></div><div id='chart' style='display:none;' align=center></div> In this code everytime eg.png is a new image.But the new image is not shown in the div but it is updating in the temp folder.
I think you missed a pair of quotes here : Code: . . else { [COLOR="Red"] tbl.innerHTML="<img src=../../temp/"+name1+".png>";[/COLOR] tbl.style.display = 'block'; } . . Try changing it to : tbl.innerHTML="<img src=\"../../temp/"+name1+".png\">";
Hi Thanks for you reply.But I tried that also but is is also not working.The issue is not with the quotes.I think the issue is in the updation of the image.The new image is updated in the temp folder.But it is not updated even when the page is refreshed. Pls help........
I have made little changes to your code and posted here the corrected one. The problem seems to be the '\' escape character that you used, which is not required in your case. The changes are marked with red colour. Code: <html> <head> <title>Sample Page</title> <script type="text/javascript"> function toggleVisiblity() { var name1="eg"; var tbl = document.getElementById("[COLOR="Red"]chart[/COLOR]"); alert(tbl); alert(tbl.style.display); alert(tbl.nodeName); var clink=document.getElementById("chartlink"); if(tbl!=null){ if (tbl.style.display == 'block') { tbl.innerHTML=""; tbl.style.display = 'none'; } else { tbl.innerHTML="<img src=../images/" + name1 + ".png>"; tbl.style.display = 'block'; } } } </script> </head> <body> <div align=left> <a id='chartlink' href=# [COLOR="Red"]onclick="toggleVisiblity()"><img src="../images/chart.gif"[/COLOR] border=0></a> </div> <div id='chart' style='display:none;' align=center> </div> </body> </html> Let me know whether this works or not.
Hi venami, I used the code inside php.So I used the escape symbol.Here I quoted just the code. And also the permission for the image is set right.It is working fine in firefox.In IE it is not working.
Then it might be the Javascript compatibility issue with IE. Since I wont be having access to the web server till Sunday, I could not help you immediately. Otherwise I could have done something now.
Hi, I found where is the issue.If I clear cache data in Internet Explorer and run the code,it is working fine.IE displays the image from the cache data instead of displaying from the temp folder where the image is stored.But I don't know how to solve this.I want the image to be displayed from the temp folder in my server. Anyone who knows can suggest me a good solution.
Hi, I have solved the issue.In IE the image is displayed from the cache.So I have changed the img src to the image file with current date and time and the issue solved. Thanks for all ur help.