[eluser]mr_coffee[/eluser]
Actually... the window.getWidth() function I'm integrating from mootools grabs the view size of the browser... not including the scrollbar if it is there. This is why I set the midrange number of 950 to check for. I'm guessing at the size of a window not fully maximized. Really... I could set a more conservative number like 900, or even 820. All it has to be is a number that would be larger than someone with a screen resolution of 800x600 could have. I'm not really interested in modifying the dimensions of all the graphics and proportions of the site based on every conceivable size of the browser window, though I might integrate some really crazy proportionate math later to do just such a thing. But I'd need JavaScript to help with that, so for now I'm just trying to effort a way to find out if JavaScript is being allowed by the browser first. If it isn't, I want to default to CSS that just doesn't care.
In this case, that CSS is going to be the largest possible size. Make those jerks with JS disabled scroll. And that's fine. But yeah, currently... I'm not concerned about every in-between size and getting it all pixel perfect for widescreens, etc. It's pixel perfect for 800x600 or 1024x768, maximized in both cases. But yeah, if I wanted to get really clever I could have javascript resize the images, margins, spacing, etc... proportionately based on viewable browser width. And I'd use the mootools function to come up with that number since it's giving me the actual size of said viewport.
But my bottom-line issue - I've determined - is if there's some method of getting CI to make a call like this:
Code:
<script type="text/javascript" src="cssFilter.php"><!--// CSS Filter //--></script>
from a "view", and actually have the php on that page performed before proceeding to the next line. There doesn't appear to be a way to get CI to pause and let that code run and then go on from there... but maybe I could sneak something like that into the controller somehow? If so, I could have that php file set a variable, and then the site would "know" that javascript was allowed from that point on, thereby I could impact how the rest of the site was assembled.
I'm really just wanting it to degrade nicely for browsers that have "allow javascript" unchecked, that's all. As far as the CSS selection and all that, it's handled quite well with javascript. But if there isn't javascript to manipulate the page... I will want to sneak in some CSS for those uncooperative souls who will deem the site unusable.
And - if you haven't gathered from my dripping sarcasm that is pooling at the bottom of this page - I am one who strongly believes there is no 10% that "can't" view javascript. I implemented javascript on a site that didn't "allow" javascript use, and manipulated a browser that not only had javascript "disabled", but also had NoScript blocking both that site and the site I had the javascript on. Still ran. Even cell phones have javascript engines built in... if there's an actual browser that doesn't have javascript functionality built in, it's installed on a hard drive that met it's expiration date 4 years ago. The only thing is I'd like the code to validate in the end. If I didn't, using <noscript> in the head would suffice.
It's unfortunate that my site wasn't for some mega-corporation like Micro$oft. Because then I could use all the buggy invalid code I wanted and users would just have to get over themselves and enable javascript to view the page as intended, and they'd automatically know that was the issue on their first visit. Unfortunately, I am not in such a position.
I'd still like more suggestions. Yours is a good one... just not for the issue I'm trying to solve.