wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes innerHTML does not work in IE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "innerHTML does not work in IE?" Watch "innerHTML does not work in IE?" New topic
Author

innerHTML does not work in IE?

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Hi I am facing a simple problem it seems as if IE cant recognize my innerHTML and returns with a run time error it works in firefox and chrome
Here is what i am trying to do

the string gets displayed in the console but i get a run time error on the next line.
The element username is present in a div element. any ideas why i am getting this ??

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Not enough info. What's in rx? Have you verified that the element is being fetched? What's the exact error? Just saying "I got an error" isn't helpful.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

innerHTML is broken in IE and depending on your use case there are different workarounds. For example:
Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Bear Bibeault wrote:Not enough info. What's in rx? Have you verified that the element is being fetched? What's the exact error? Just saying "I got an error" isn't helpful.


Rx is a string which the java function received as a response from an http asynch request. And yes i verified it. by using console.log(rx) also it works in firefox but not in IE . All i get is "runtime error" according to IE 8.0
Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

You have to open Developers Tools (F12) in order to access console in IE8.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What is username? Is it a input, div, etc?
What is the string you are trying to add to the page?

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Rajesh Khan wrote:Rx is a string which the java function received as a response from an http asynch request.
That does not answer my question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: innerHTML does not work in IE?