Solved

IE leaving &nbsp in innerHTML after being cleared

Posted on 2006-07-03
3
527 Views
Last Modified: 2012-06-27
Hello Everyone,

I am currently programming a folder interface in ajax and am having an issue with IE.  

I am currently using a div to display folder information when the folder is clicked, then clearing it when the folder is clicked again.  Whats happening, is the IE seems to be leaving an   in the div after I set it to "".  The program can be seen at http://www.cipherintegrations.com/cfile/file.php ......

It works correctly in FireFox, but isn't quite right in IE... the relevent function seems to be:

function clearDiv(div) {      
  document.getElementById(div).innerHTML = "";      
}

Any ideas?

Thanks!
0
Comment
Question by:sbaylis
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 250 total points
ID: 17030533
How about:

function clearDiv(div) {    
  document.getElementById(div).style.display="none";    
}


Do you know PageSpy: http:/M_1344026.html

0
 

Author Comment

by:sbaylis
ID: 17030572
Good call.... Worked like a charm. Thanks!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 17030583
You are welcome.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now