• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE - 'html()' is null or not an object

 
Melcolm Aslam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only get this error in IE browser and not in firefox.

here is my code that is causing this Error:

if($('#isAll').exists()

&& $("#ErrorMsgDiv").html().trim()==""

&& $("#AjaxErrorMsgDiv").html().trim()!=""){

$("#ErrorMsgDiv").html($("#AjaxErrorMsgDiv").html());

}


please help
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is jQuery getting properly loaded in IE?
 
Melcolm Aslam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes everything works perfectly normal in firefox. In internet exploer I get this message 'html()' is null or not an object " . I know that it is a syntax error that is not supported by IE browser.

here is the image of the exact message.

Filename: error.bmp
Description: Error MSG
File size: 355 Kbytes
[Download error.bmp] Download Attachment
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't answer my question.
 
Melcolm Aslam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i confirm if it is getting loaded properly?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the browser's debugger it will show everything that's going on. Or, does jQuery work elsewhere? Is this happening at page load? Or as the result of an event?
 
Melcolm Aslam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a result of an event.

When i click pagination " first, previous, 1,2,3,4,5, last"




 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so if there are no errors before that, it's likely jQuery has loaded. I assume that there are no other errors appearing before that?

Is the .html() function used elsewhere? Try using one in the ready handler and see if it generates an error.

Which line is 216? (And in the future, please copy/past error text rather than attaching an image.)
 
Melcolm Aslam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright thank you so much i fixed the issue


&& $("#ErrorMsgDiv").html().trim()==" "

&& $("#AjaxErrorMsgDiv").html().trim()!=" ")

instead of

&& $("#ErrorMsgDiv").html().trim()==""

&& $("#AjaxErrorMsgDiv").html().trim()!="")


there should be a a space between the quotes cause some browsers can not read that meaning clearly
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic