htmLawed & Javascript at bottom of html file

mikeytown2 - January 9, 2009 - 23:33
Project:Beautify
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:psynaptic
Status:active
Description

If you change the garland theme so that the javascript it outputted at the end of the document, javascript doesn't load correctly.
Following these rules
http://developer.yahoo.com/performance/rules.html#js_bottom
http://wimleers.com/article/improving-drupals-page-loading-performance#r...

Built-in doesn't have this issue.

#1

psynaptic - January 10, 2009 - 12:00

Ahh yes, I use JS at the bottom of my page too.

I've found that it works on my test site and on 1 live site although the script tags are not well formed like they are when they are in the head.

Can you describe the problem a little more so I can try and track this down?

#2

mikeytown2 - January 11, 2009 - 01:16

Using Javascript Aggregator, and Dhtml Menu as well.
http://drupal.org/project/javascript_aggregator
http://drupal.org/project/dhtml_menu

I can't think of any thing else that would effect it

#3

psynaptic - January 13, 2009 - 10:47
Assigned to:Anonymous» psynaptic
Status:active» postponed (maintainer needs more info)

I have installed DHTML Menu and Javascript Aggregator, enabled the permissions 'access administration pages' and 'administer site configuration' for anonymous users, set the JS aggregation to on and placed the administer menu in the left sidebar of Garland. JavaScript is still functioning for me with $scripts at the bottom as in Wim Leers' guide. I have tested in both Beautify and Compact modes of htmLawed.

It might be something else about your setup that's causing this. Can you explain more so we can try and track this bug down? Thanks.

#4

mikeytown2 - January 13, 2009 - 23:35

I think it revolves around HTML and XHTML

I've disabled JS and it still gives me a very odd page layout on the Modules Page

in FF3 heres the view source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
  <title>Modules | Blue Diamond Home & RV</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/drupal-6.8/sites/default/files/favicon.ico" type="image/x-icon" />
  <link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/node/node.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/admin.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/defaults.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/system.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/system-menus.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/user/user.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/cck/theme/content-module.css?7" />

<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/date/date.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/directory/directory.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/filefield/filefield.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/graphstat/graphstat.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/imagefield/imagefield.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/office_hours/office_hours.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/tabs/drupal-tabs.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/text_resize/text_resize.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/faceted_search/faceted_search_ui.css?7" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/themes/my_garland/style.css?7" />
<link type="text/css" rel="stylesheet" media="print" href="/drupal-6.8/sites/all/themes/my_garland/print.css?7" />
  <!--[if lt IE 7]>
    <link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/themes/my_garland/fix-ie.css" />    <![endif]-->
</head>
<body >
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; Modules | Blue Diamond Home &amp; RV

<div id="header-region" class="clear-block">
</div>
<div id="wrapper">
  <div id="container" class="clear-block">
    <div id="header">
      <div id="logo-floater">

Here's the view generated source

<html dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>


  <title>Modules | Blue Diamond Home &amp; RV</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="/drupal-6.8/sites/default/files/favicon.ico" type="image/x-icon">
  <link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/node/node.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/admin.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/defaults.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/system.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/system/system-menus.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/modules/user/user.css?7">

<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/cck/theme/content-module.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/date/date.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/directory/directory.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/filefield/filefield.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/graphstat/graphstat.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/imagefield/imagefield.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/office_hours/office_hours.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/modules/faceted_search/faceted_search_ui.css?7">
<link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/themes/my_garland/style.css?7">
<link type="text/css" rel="stylesheet" media="print" href="/drupal-6.8/sites/all/themes/my_garland/print.css?7">
  <!--[if lt IE 7]>
    <link type="text/css" rel="stylesheet" media="all" href="/drupal-6.8/sites/all/themes/my_garland/fix-ie.css" />    <![endif]-->
</head><body>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; Modules | Blue Diamond Home &amp; RV

<div id="header-region" class="clear-block">
</div>
<div id="wrapper">
  <div id="container" class="clear-block">
    <div id="header">
      <div id="logo-floater">

#5

mikeytown2 - January 14, 2009 - 22:54
Status:postponed (maintainer needs more info)» fixed

latest div fixes this. I think it does, anyway kinda a mute point since logged in doesn't see output, and the error is the most evident on the admin module page.

#6

psynaptic - January 16, 2009 - 02:12

Hi mikeytown2, thanks for the help.

It looks like the doctype is being added back wrongly. If that was the case then it wouldn't be just happening on the modules page. Can you have a look with anonymous users and see if you can see the doctype being put back in the wrong place, or anything that might help us sort this (unless it's fixed!).

#7

mikeytown2 - January 16, 2009 - 08:36
Status:fixed» active

I think it was the cache... JS appears to have stopped working again.

#8

psynaptic - January 16, 2009 - 12:43

Oh, that's a shame. Can you paste your HTML source again?

#9

mikeytown2 - January 17, 2009 - 09:26

K figured this one out i think after doing a diff on the source...

Normal Output

<script type="text/javascript">
<!--//-->
<![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/",



Mod Output
<script type="text/javascript">

<![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/",

Not 100% because the diff program had a lot of trouble with the files but, I think this is it.

#10

psynaptic - January 17, 2009 - 18:23
Status:active» postponed (maintainer needs more info)

The seems to just remove a comment which wouldn't cause any problems.

Please post the source of your unprocessed and processed HTML. Thanks.

#11

mikeytown2 - January 18, 2009 - 00:57
AttachmentSize
a.zip 10.99 KB

#12

mikeytown2 - June 22, 2009 - 03:45
Status:postponed (maintainer needs more info)» active
 
 

Drupal is a registered trademark of Dries Buytaert.