Author: mgrigorov Date: Sat May 7 19:07:15 2011 New Revision: 1100594 URL: http://svn.apache.org/viewvc?rev=1100594&view=rev Log: WICKET-3683 Ajax Debug Window does not display info
First try .innerHTML (non-xhtml pages) and if it fails use the DOM node replacement approach (xhtml support). merge r1100592 from trunk Modified: wicket/branches/wicket-1.5-RC4/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax-debug.js Modified: wicket/branches/wicket-1.5-RC4/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax-debug.js URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.5-RC4/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax-debug.js?rev=1100594&r1=1100593&r2=1100594&view=diff ============================================================================== --- wicket/branches/wicket-1.5-RC4/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax-debug.js (original) +++ wicket/branches/wicket-1.5-RC4/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax-debug.js Sat May 7 19:07:15 2011 @@ -230,24 +230,25 @@ var WicketAjaxDebug = { doInnerHTML: function(elem, html) { try { - var children = elem.childNodes; - - for (var i = 0; i < children.length; i++) { - elem.removeChild(children[i]); - } - - var nodes = new DOMParser().parseFromString(html, 'text/xml'); - var range = document.createRange(); - range.selectNodeContents(elem); - range.deleteContents(); - - for (var i = 0; i < nodes.childNodes.length; i++) { - elem.appendChild(nodes.childNodes[i]); - } + elem.innerHTML = html; return true; } catch (e) { try { - elem.innerHTML = html; + var children = elem.childNodes; + + for (var i = 0; i < children.length; i++) { + elem.removeChild(children[i]); + } + + var nodes = new DOMParser().parseFromString(html, 'text/xml'); + var range = document.createRange(); + range.selectNodeContents(elem); + range.deleteContents(); + + for (var i = 0; i < nodes.childNodes.length; i++) { + elem.appendChild(nodes.childNodes[i]); + } + return true; } catch(ee) {