Help: All my styling is gone! I may have found the problem!
flyingdutchie
Registered Users Posts: 1,286 Major grins
Instead of the inline-script and the in-line css, this is generated:
<script src="http://www.smugmug.com/include/js/user_flyingdutchie.js" type="text/javascript"></script>
<link href="http://flyingdutchie.smugmug.com/include/css/user_flyingdutchie.css" type="text/css" rel="stylesheet" />
E.g. i have <script> elements inside my 'JavaScript' cobranding. Same for CSS: I have <LINK> and @import elements there.
This will not work in *.js file and/or *.css files.
Smugmug, could you please not do that. Leave it as it was, putting inline javascript and inline css inside the HTML instead of moving it into external files. I would be very gratefull.
-- Anton.
<script src="http://www.smugmug.com/include/js/user_flyingdutchie.js" type="text/javascript"></script>
<link href="http://flyingdutchie.smugmug.com/include/css/user_flyingdutchie.css" type="text/css" rel="stylesheet" />
E.g. i have <script> elements inside my 'JavaScript' cobranding. Same for CSS: I have <LINK> and @import elements there.
This will not work in *.js file and/or *.css files.
Smugmug, could you please not do that. Leave it as it was, putting inline javascript and inline css inside the HTML instead of moving it into external files. I would be very gratefull.
-- Anton.
I can't grasp the notion of time.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
0
Comments
The contents of my 'inline' javascript is this:
The bold&italic elements won't work if they are moved inside a *.js file:
1. <script> and </script> is invalid javascript.
2. <!-- and --> is invalid as well.
Similar situation for my CSS.
-- Anton.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
OK, I see what's going on. This is related to the "performance improvements" for themes and styling. It looks like rather than putting all your styling inline on every page in your site, they've moved it to an included file so that browsers can cache it more effectively. That's a good thing, in general.
But...that does ruin some capabilities that used to be available (that's a bad thing).
Hmmm, I'll have to leave it to the experts to figure out whether there are work-arounds or whether smugmug should change something. I believe smugmug should be using included style sheets for user customizations so browsers can more efficiently cache this info and improve perceived site performance. But, I don't know what technical options there are available to let you continue to have the features you used to have while still gaining this efficiency.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
I'd really like the old situation back! My CSS and JS is relying on it!
E.g my JS calls document.writeln("...") statements so that the browser loads browser-specific CSS. These are the contents of my co-branding CSS:
Please, smugmug, change it back as it was before... I would be very gratefull.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
The other side benefit - is that your site will not have to rely on external js or css, which in some cases would slow down the site considerably or give security warnings in IE.
My suggestion: cut and paste your external source files. Your visitors will appreciate a faster site.
It looks like the header and footer contents are still inline in the page. Can you move this script stuff to the header area and out of your script area so smugmug will still inline it?
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
I have to be able to call javascript inside my 'CSS' section (see my previous post)!
Please allow us users to host CSS and/or javascript files on other sites, if we want to. I'm not really willing to spend hours and hours to fix this.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
Again, this is probably not going to happen since it affects a SUPER small percentage of users.
You can try to use these techniques for including CSS and JS though:
http://www.thescripts.com/forum/thread149165.html
http://css-discuss.incutio.com/?page=ImportHack
I don't know what to do. Can't you make these optimizations optional?!
Helplessly greetings,
Sebastian
SmugMug Support Hero
But how would i call my 'includeBrowserCSS()' now... (see my previous post)? It has to be inside the <HEADER> tag!
I hoped i had the evening off ... guess not.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
Thanks,
Sebastian
SmugMug Support Hero
onload = includeBrowserCSS;
I moved my
<script language="javascript" type="text/javascript" src="http://www.antonspaans.com/mysmugmug.js"></script>
to the 'Header' section... so this part is fixed.
But now, how can i fix my CSS issues?
This is my old code:
the 'includeBrowserCSS()' calls document.writeln("....") to write out browser specific CSS (checks browser and writes CSS accordingly).
-Also, how would i specify the 'shortcut icon'?
-How would i make sure that all the CSS (either through <LINK> tags or through 'includeBrowserCSS()') is written out inside the <HEAD> tag?
-In general, how would my new CSS code look like to fix my issues? Thank you!
-- Anton.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
the 'includeBrowserCSS()' must be called inside the <HEAD> tag, after the inclusion of smugmug's CSS-stylesheets.
It can not be called after or before the <HEAD> tag or after the document has been loaded.
-- Anton.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
so in order to do this with your favorite icon:
So just add those lines to whatever function or onload that you need.
When the page has loaded, for a fraction of a second users see the page without any CSS styling. Then after that fraction they see the co-branding style being applied. This gives a nasty 'flicker' effect.
And some browsers don't like this at all:
The browser finished loading and laying out the document.
Then after the load, the CSS changes... some browser get mixed up and the layout is incorrect.
-- Anton.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
Hope Anton finds a solution.
Sebastian
SmugMug Support Hero
But for browser compliance i should do it inline inside the <HEAD> tag:
<LINK> and <STYLE> elements should be inside the <HEAD> tag.
But it seems that at least FireFox and IE6.0 don't care about the exact spot of <LINK> and <STYLE> elements. Just now, i changed my co-branding to write-out these elements inside the <BODY> tag:
I moved the contents of the co-branding's 'CSS' field to the top of the 'header' field. IE6.0 and FireFox don't seem to mind, although it is invalid (X)HTML.
When i'm home i'll try if Opera and Netscape are happy with it too
Could someone try my site in Safari 1.2 (or higher)?
JT, Sebastian and everyone else, thanks for you help!
-- Anton.
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
You're the man!
Sebastian
SmugMug Support Hero
Thanks!!!!
Although, it is a good idea to have the CSS and JS cacheable. Maybe (later) you can add a checkbox that let the smugmugger either use inline CSS/JS versus CSS/JS in a seperate cacheable file.
Thank again, JT!
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
What you are seeing is a work around for caching - it will only be inline for a little bit.
I will keep using my work-around as described earlier (put my CSS and JavaScript on the top of my cobrandig's 'Header').
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com