homepage Welcome to WebmasterWorld Guest from 54.234.128.25
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
dynamic stylesheet
RevealatoR




msg:1212426
 6:25 pm on Jan 12, 2003 (gmt 0)

Hi All,

this is my first post here:


<script type="text/javascript"><!--
document.write(\'<link rel="stylesheet" type="text/css" href="http://www.blabla.net/dynamic_resolution_stylesheet.php?width=\' + screen.width + \'&height=\' + screen.height + \'&pixelDepth=\' + screen.pixelDepth + \'&colorDepth=\' + screen.colorDepth + \'&availWidth=\' + screen.availWidth + \'&availHeight=\' +screen.availHeight +\'>\');
--></script>

this way you can, if javascript is enabled, generate a dynamic stylesheet with font-size for a specific resolution.

hope you know what i mean ;-)

 

andreasfriedrich




msg:1212427
 6:55 pm on Jan 12, 2003 (gmt 0)

Welcome to WebmasterWorld [webmasterworld.com] RevealatoR.

Be sure to read Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post.

This is basically the same technique used by a lot of logging systems. Build a query string using javascript and then request some resource on some server.

Could you explain why you are escaping the single quotes. AFAIK they should not be escaped since you need them as the string delimiter. You would need to escape a single quote if you wanted to have it as a ordinary character in a string delimited by single quotes.

var test = 'Aaron\'s Party';

Andreas

RevealatoR




msg:1212428
 7:23 pm on Jan 12, 2003 (gmt 0)

Could you explain why you are escaping the single quotes

sure, it was a snipped of a php script of mine.

andreasfriedrich




msg:1212429
 7:41 pm on Jan 12, 2003 (gmt 0)

Please make sure that when you post code it is working code. There are a lot of people around here who just copy and paste. They might not know why something is not working the way it is advertised.

If you are not sure, i.e. the code has not been tested, please say so explicitly.

Using here doc syntax in PHP would have saved you from having to escape quotes at all.

Andreas

RevealatoR




msg:1212430
 9:00 pm on Jan 12, 2003 (gmt 0)

i did not say it works out of the box, but ok.

andreasfriedrich




msg:1212431
 9:12 pm on Jan 12, 2003 (gmt 0)

You did not and Im sorry if my comments were too harsh.

Andreas

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved