-
1. Re: firefox 11 and richfaces 3.1.5.GA/jsf 1.1.11 html injection
jhaoamral Mar 16, 2012 5:29 PM (in response to jokerdude)Hi,
I have the same problem, I had this problem only with the Google Chrome, but now this happens with FF also.
Could you show how to solve the problem with jquery?
thanks.
-
2. Re: firefox 11 and richfaces 3.1.5.GA/jsf 1.1.11 html injection
jeanblanchard Mar 19, 2012 1:07 PM (in response to jhaoamral)Hi
I've had this issue for a while, since I use Firefox nightly builds.
The issue is actually caused by Firefox starting to support the "outerHtml" DOM property, so the "A4J.AJAX._scriptEvaluated" code is inserted using the fallback IE-targetting code instead of the code targetting modern browsers.
To fix it you would have to update the file /org/ajax4jsf/javascript/scripts/AJAX.js from richfaces-impl.jar.
Unfortunately, I don't have access to the library, so here is the ugly workaround I'm using :
<!--[if !IE]> -->
<script type="text/javascript">
// <![CDATA[
function fixA4J() {
var bodies = document.getElementsByTagName("body");
if (bodies.length > 1) {
for (var i = 0; i < bodies.length; i++) {
if (bodies[i].firstChild == null) {
bodies[i].parentNode.removeChild(bodies[i])
break;
}
}
var heads = document.getElementsByTagName("head");
for (var i = 0; i < heads.length; i++) {
if (heads[i].children.length == 1) {
var s = heads[i].firstChild;
heads[i].parentNode.removeChild(heads[i])
document.head.appendChild(s);
break;
}
}
}
window.setTimeout(fixA4J, 100);
// ]]>
</script>
<!-- <![endif]-->
Basically, it's a timer that checks periodically if RichFaces has broken the page, and then fixes it by removing the extra heads and bodies.
-
3. Re: firefox 11 and richfaces 3.1.5.GA/jsf 1.1.11 html injection
jboydnolan Oct 16, 2012 4:29 PM (in response to jeanblanchard)Has anyone come up with a better solution to this situation? We see the same behavior, but it's very random. Sometimes the extra header and body get injected at the top of the page causing a bunch of blank space. Other times the injection happens below the main body, which allows the page to appear normally. I tried the javascript above and it seems to take care of the header, but the multiple body tags remain...not sure exactly why yet.
-
4. Re: firefox 11 and richfaces 3.1.5.GA/jsf 1.1.11 html injection
jithu2000 Nov 12, 2012 7:17 AM (in response to jeanblanchard)Hi Jean,
We had the same issue in our jsf code. The javascript code worked for us. Thanks a lot!!