After the days of hacking away at Golden Cheetah and C++ on Windows, doing some html/css/php/js coding is like a breath of fresh air. There is something somewhat comforting about how rigid C++ is…I can quickly find where I’ve messed up, even if it takes me a bit to figure out how to correct my bugs. These interpreted languages have vagueness, but it’s still fun to fire away at them and not have to deal with compiling or linking.
Anyway, I’m working on coding Kara’s new site and am using it as an excuse to learn jQuery. After tediously hacking the DOM in the past this is really easy. There is a download hit for the jQ library, but it’s not much more than a small image. I wonder how it will work on a mobile device…
The design challenge from my perspective is to make the code intelligent enough to speed up content management but not so obtuse that Kara won’t be able to directly edit the pages. In other words, a database driven CMS is overkill here. I also want to allow her to directly link to individual pages, if she needs to show of a particular project. So, it’s in progress, but half the fun is brainstorming the possibilities and making the code work, no? I’ll link the site when it’s live, but for now here’s the jQ code for generating the links on the fly:
$("#sidebar a").click(function(event){ // this is verbose, but the steps are clear // it will create links from the button names var label = $(this).text(); label = label.toLowerCase(); //replace spaces with underscores label = label.replace(/ /g,'_'); //append the php file extension label += ".php"; // update the html and go $(this).attr("href",label); });
Leave a Reply
You must be logged in to post a comment.