Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Insertion problems with Opera
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jens Müller, post: 4519776"] Hi, as I couldn't figure out how to post to the Ruby Spinoffs forum directly, I am starting a new post here and hope some kind admin can move it over to the appropriate forum. I am trying to insert a new row to a table using prototype's "new Insertion.Bottom" which works fine in all popular browsers except for Opera. Digging into the code of prototype 1.5.0_rc0 I discovered that insertAdjacentHTML() is used for Opera: ---- lines 1147-1154 ---> if (this.adjacency && this.element.insertAdjacentHTML) { try { this.element.insertAdjacentHTML(this.adjacency, this.content); } catch (e) { var tagName = this.element.tagName.toLowerCase(); if (tagName == 'tbody' || tagName == 'tr') { this.insertContent(this.contentFromAnonymousTable()); } else { <------------------------ If I insert a simple "throw('bla')" in the first try-block, so that the catch-part is run, it works in opera. I boiled down the lengthy code and put up a test case [1] which uses insertAdjacentHTML() to add a new table row and you can see (when the updated innerHTML of the table is displayed) how opera seems to completely ignore the TR and TD tags yet handling B and I correctly. ---- interesting parts from the test case----> tbl = document.getElementById("mytable"); tbl.insertAdjacentHTML("beforeEnd", "<tr><td><b>newCellone</b></td><td><i>newCelltwo</i></td></tr>"); <------------------------ I know I could use DOM functions like insertRow() to circumvent that problem but I want to make use of prototype's functions as much as possible. I would appreciate any kind of help as to how to maybe change the prototype code without breaking other browsers or another way of working around this apparent bug. [1] TEST CASE - [URL]http://buzzinhornetz.ath.cx/tmp/adjacent.html[/URL] Thanks in advance, schdewwn [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Insertion problems with Opera
Top