This site is a self-contained low down on what's going on in my life, what I'm working on, what I'm thinking about, and how I'm feeling about life in general.
Sunday, 13 April 2008
I currently use a rich text editor called Tiny MCE to write the articles for this site. When I started using it, I thought it was the bees knees, but I've come to find it has more than its fair share of drawbacks.
For one, I find myself circumventing it more and more, it strips my code tags, removes / from the beginning of internal links, and completely strips http://www.mattknott.com/ which can be annoying when you are referencing content from multiple locations!
In addition to all of this, I go into html mode a fair bit adding in syntax to try and maintain xhtml 1.0 strict adherence. There has to be an easier way.
This week I'm going to have a stab at a solution based around tag suggestion, similar to the Dreamweaver code editor, triggered by <, a list of tags appears, and refines as I continue to type. Clicking a tag will insert the text I want, the way I want it, including alt tags and title tags for images and links respectively.
I will post an update as to how I get on, as it's going to be a bit of a challenge, but with any luck it'll be something to expand upon in the future.
Sunday, 09 March 2008
Sad I know but some times you come across a rare bit of syntax that most people just don't know about.
Take, for instance <optgroup>.
I recently came across this on a random website, and when I mentioned it in work, no one had heard of it. Now these are all, including myself, guys with 14+ years experience at writing HTML amongst other things.
The annoying thing was the number of times we'd needed something to perform the function of this simple tag, yet floundered and compromised, using some work around or other.
What optgroup does, is simply create a heading within a select list. A non-selectable element that categorises the values below it.To implement this within your select list, just add the following code:
<optgroup label="GMT-10:00"></optgroup>
It's that simple, give it a try.
Wednesday, 13 February 2008
When developing applications with AJAX functionality, it is common to pull a value from a text area and pass in into a url for processing.
When doing this, always be sure to add the escape() function around your variables, to ensure they are URL Encoded, otherwise you'll loose parts of your text and your code will fall apart.
If you've escaped a variable, for passing between functions rather than a url, you can remove the formatting with the unescape() function.