You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/06/09 11:26:10 UTC

svn commit: r952920 - /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js

Author: werpu
Date: Wed Jun  9 09:26:10 2010
New Revision: 952920

URL: http://svn.apache.org/viewvc?rev=952920&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2747

Ok IE6 as usual hates dom manipulation while it renders the body and terminates upfront with an error (old ie6 bug never fixed and never will be), deferring is not an option since inline scripts might rely on
jsf.ajax already being present.
What I am doing now is simply to run the globalEval in case of IE6 instead of relying on the head manipulating loading routines.
I have changed the code my example now works again with IE6 even if it loads the jsf.js automatically within the body.

This problem occurs anyway only in debug mode when the subloading happens (new feature of the 2.0.1 codebase per request from Leonardo) and only on IE6 (and maybe ie7 but I doubt it) which is the only browser which has this problem.
In either way we have to add a fallback for those browsers that under no circumstances the scripts should be attached to the body but the head instead (while other browsers like chrome forbid explict html head alteration, one reason why globaleval for instance in jquery fails on webkit)

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js?rev=952920&r1=952919&r2=952920&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js Wed Jun  9 09:26:10 2010
@@ -352,7 +352,14 @@ if (!myfaces._impl.core._Runtime) {
             //if a head is already present then it is safer to simply
             //use the body, some browsers prevent head alterations
             //after the first initial rendering
-            var position = document.getElementsByTagName("body").length ? "body" : "head";
+
+            //ok this is nasty we have to do a head modification for ie pre 8
+            //the rest can be finely served with body
+            var d = this.browser;
+            var position = "head"
+            if(!d.isIE || d.isIE >= 8) {
+                position = document.getElementsByTagName("body").length ? "body" : "head";
+            }
 
             try {
                 var holder = document.getElementsByTagName(position)[0];