from the whirlpool.net.au discussion forums
web hosting by WebCentral Australia
   AJAX with Opera View full version
User #21170   6317 posts
In the penalty box

I find with development MSIE is a hard one to work with. Now it seems Opera wants to annoy me!!

I have a <table id="some_id"> and am (at regular intervals) updating that table with innerHTML (via AJAX). It works fine with Opera and MSIE, but when it replaces the innerHTML in Opera, it renders it without any CSS or bgcolor on the TD/TR's.

Also while i'm at it. Opera has a serious problem with 'direction'. I have a form that, when submitted, submits it to a page which does the database work, then header() back to the page they are on (to reload it). But Opera just 'hangs' and doesn't reload the page. It does the database stuff it just won't go back to the page.

Has anyone else had problems with AJAX and Opera?

posted 2006-Mar-28, 7pm AEST
User #19408   3813 posts
Whirlpool Forums Addict

Opera can be a bit temperamental when it comes to AJAX-type stuff, especially in terms of redrawing the page and redirections on forms in some unusual circumstances, but nothing's going to happen with it until the next major release (Opera 9.0.)

Submit bug reports (Help->Report a site problem... or bugs.opera.com) and cross your fingers (and maybe try the weeklies from my.opera.com/desktopteam/blog - latest Windows weekly is o90w_8321m.exe - to see how your code does in Opera 9 as it stands today.)

posted 2006-Mar-28, 7pm AEST
User #43220   7349 posts
In the penalty box

Travey writes...
but when it replaces the innerHTML in Opera, it renders it without any CSS or bgcolor on the TD/TR's.

blah ... innerHTML ... you should be getting stuck into the DOM, and make the membres users browser do some work for a change

posted 2006-Mar-28, 7pm AEST
User #89329   642 posts
Whirlpool Enthusiast

Travey writes...

I have a <table id="some_id"> and am (at regular intervals) updating that table with innerHTML (via AJAX). It works fine with Opera and MSIE, but when it replaces the innerHTML in Opera, it renders it without any CSS or bgcolor on the TD/TR's.

Oooh, me! I HATE those problems, and in fact saw much worse. It seems rewriting TR content is not at all well supported at all. I seem to recall issues with Safari with this also. Most irritating, and caused me to rewrite a whole lot of stuff in a non-optimal way.

I'm using Ajax in association with Rails, by the way.

posted 2006-Mar-28, 8pm AEST
User #80562   1044 posts
Whirlpool Enthusiast

The .innerHTML attribute was invented by Microsoft for IE, and was later picked up by other browsers with mixed levels of success. It doesn't even work for all elements in IE (eg: the <select> element).

Don't use it if possible. Instead, use DOM methods:
  document.createElement(tagName);
  document.createTextNode(text);
  <DOM node>.appendChild(newNode);
  <DOM node>.insertBefore(newNode, beforeThisNode);
  <DOM node>.removeChild(childNode);

and the .childNodes attribute.

There are some issues in IE with setting the .name attribute on dynamically created DOM nodes (explained here).

posted 2006-Mar-29, 12am AEST
 
© Whirlpool Broadband Multimedia