Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

innerHTML does not work in IE?

 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marcin Kwiatkowski
Ranch Hand
Posts: 32
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
innerHTML is broken in IE and depending on your use case there are different workarounds. For example:
 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to open Developers Tools (F12) in order to access console in IE8.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic