javascript document.write causing head elements to render in DOM body
---------------------------------------------------------------------

                 Key: MAGNOLIA-3110
                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3110
             Project: Magnolia
          Issue Type: Bug
          Components: admininterface
    Affects Versions: 4.2.3
         Environment: All browsers, XHTML 1.0 Strict
            Reporter: Nickolaus Wing
            Assignee: Philipp Bärfuss
            Priority: Minor
         Attachments: inline.patch

In the admin-interface module, inline.js contains 3 document.write statements 
that create divs for later use by javascript.  If we use <cms:links/> in the 
<head> of the page, this javascript will be included in the head.

Then, the browser will execute those document.writes during the loading of the 
<head> element, writing out divs that belong in the <body>.  This causes all 
known browsers to begin the body element immediately in their internal 
representation.  Thus all tags following <cms:links/> will appear in the 
<body>, according to the DOM.

This has always been annoyingly messy when using something like firebug to 
examine a document, but it also caused serious problems when including 
Scriptaculous, which attempts to find itself in the <head> in order to include 
more files, which obviously it can't do if it's been moved to the <body>.

It can be solved with the attached patch, which moves the creation of these 
divs to the window.onload event (in a crossplatform, unobtrusive fashion).

The file to be patched is m-m-admininterface/.../admin-js/inline.js

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to