And that's about it. In this second part, I hope you've enjoyed the handy technique I explained for changing two style sheets in a Web document. It should have offered you some insight into JavaScript's processing power for manipulating CSS style changing without getting a single foot into server-side approaches. Everything has been maintained within the domain of the client.
However, there are a couple of issues yet to be considered. First, what's the point on swapping style sheets if we cannot make the process reversible? And second, if we were able to turn on and off style sheets alternately in a single Web document, the change would be kept only until the next page request. If the user ever had the "bad" idea to click on any links, our carefully crafted technique to swap style sheets would be gone with the wind. Obviously, the whole process is stateless.
These issues should be efficiently addressed. Those reasons are good enough to head us directly to the last part of this series. In it, I'll be discussing and implementing some interesting approaches to change any number of styles sheets, and making that change persistent across several Web pages. Want to know more? Just stay tuned until the next article. The wait will be worth it!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |