Solved

IE leaving &nbsp in innerHTML after being cleared

Posted on 2006-07-03
3
530 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
alert(innerHTML); 8 33
JavaScript to set default value on SharePoint form field 7 20
Fix Form size HTML 16 15
Understanding UserAgent String 2 18
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

820 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