Hello,
I have just installed Drupal 4.6.5 on my website hosted with webhost4life which uses IIS as web server. Though the installation went flawless I experience one rather irritating issue. Apparently the theme is applied after a short delay meaning every page change results in an immediate update of the content in style-less HTML, and only after a second the content is formatted according to the theme. If you like you van witness this behaviour yourself through the following temporary URL: http://site333.mysite4now.com/gerturo/dplbertjammaer/index.php.
Is this issue a side-effect of using IIS? I know it is recommended to run Drupal on Apache, but I have already signed up with webhost4life and if possible want to avoid switching to a different hosting provider. Has anyone else experienced the same issue, and is there a simple solution for it? Is the issue caused by IIS, or is there some setting I should apply?
Regards,
Gert.
Comments
Browser
To me that sounds more like a browser issue related to the loading of CSS rather than an issue with Drupal itself or even your hosting. I'm not seeing this issue loading your site from Firefox though it does happen when I load it for the first time in IE.
I also have a feeling that
I also have a feeling that this is related to IE loading the css (I don't use IE my self but I have seen this happen sometimes on different sites with IE)
I think I saw a post related to this a couple of weeks ago, but cannot find it now...
I believe this is the horrid
I believe this is the horrid Flash of Unstyled Content bug in IE. This could be avoided by having a link to a stylesheet in your document head. I am not able to post suggestions here despite using code tags, beware the evil stylesheet links, but this is explained at http://bluerobot.com/web/css/fouc.asp
Yep, IE is causing the delay.
Thanks for the quick replies on my first message on this site! I have just installed Firefox and indeed the problem doesn't occur when viewing my site with this browser. Can it be that the combination IIS-PHP-IE is the issue as other Drupal sites including this very page run just fine in IE. If this is the case I assume I have to switch to Apache.
Regards,
Gert.
I run IIS/PHP/MySQL and
I run IIS/PHP/MySQL and don't have the issue.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
this is a msie issue
google "flash of unstyled content" ..
FOUC: Flash of Unstyled Content
Thanks for your tip jadwigo, this is form one of the links that search resulted in - From Community MX
flash of unstyle content
keep this code in the head section
[script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script]Replace '[ ]' with angular brackets drupal didn't allow me to post with angular brackets.
Sunny
www.gleez.com | www.sandeepone.com
Sunny
www.gleez.com | www.sandeepone.com
Simple FOUC Fix
I'm running a mod of the 'Blix' theme at www.GettingPrimitive.com and the site was suffering from the FOUC problem. The best place to put the fix seems to be in includes/common.inc. Here's how:
Just before the line:
return $output . drupal_set_html_head();Put a line like this:
$output .= ' [script type="text/javascript"] [/script]';(Replace the squarebrackets with anglebrackets, just like Sunny said).
-------------------------------------------
Interactive Worlds and Immersive Obsessions
www.asifproductions.com
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Or modify theme.inc and change @import to link
Another option is change the theme_stylesheet_import() function in includes/theme.inc to use the
<link>method instead of the @import method.According to my research @import is used to provide backward compatibility with IE4 and Navigator4. Removing @import resolved the CSS delay in IE and did not have any negative effects on current versions of Safari, Firefox, and Opera.
Where to put the FOUC remedy
Hi folks,
I have been trying to get rid of the FOUC but have so far been unsuccesfull. I have been unable to put it in the spot where it does its job...
Could any of you specify what line of code needs to be placed where in which drupal file (drupal 5.7)? f.i. do I need to replace ALL @import commands with [link] like the folowing:
drupal_set_html_head('[style type="text/css" media="all"]@import "'. base_path() .'misc/maintenance.css";[/style]');
to
drupal_set_html_head('[style type="text/css" media="all"][link] "'. base_path() .'misc/maintenance.css";[/style]');
Many thanks in advance!
Sven
FOUC remedy in page template
You can do it as HTML in the page template if you want to. Inside the HEAD section. Like this:
<script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Where is the head section?
Thanks for the reply!
As a website newbie, I haven't got a clue where the head section is...
Is it in a template, in includes?
Putting it in place once I know the location will go just fine.
<HEAD>
In the page.tpl.php file for your theme, anywhere between the
<HEAD>and</HEAD>tags.-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com
Mmm, that file is virtually empty...
And there is no [head] tag there...
Can the part that holds the [head] tag be imported from yet another file?
possible
It could be, but even so it would still probably be a tpl.php file located in the folder of your theme. When you do a View Source on your page (in your browser), I'm sure you will see the HEAD tags. It's just a matter of finding the template file responsible for putting them there.
-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com