Updating the blog preview window

Updating the blog preview window

A little something I\'m trying

It is becming evermore apparent to me that the goal of having these blog posts editable is a lot further away than I thought. I mean I could put in a rather crude way to pull data in from the database but as I\'ve started to use this blog a bit more I can far more easily see the blatant flaws in it. To fix them now would be far easier than it would if I just charges forward. And so here I am trying to update the blog preview interface.

Previously I was being a massive idiot (a habit I probably won\'t be stopping any time soon). I had two forms on the preview page, one which would post back to the page in order to display the information and another to actually post the information to the database. This was silly, as if I wanted to preview some text I\'d have to press one whole button. I realise that isn\'t a huge deal but now every time you press a key the preview space updates, this means that is way easier to see how your text looks on screen so that you can plan your paragraphs. In practice this is a major convenience.

Another boon is the HTML!

Because I\'n now using the javascript \'innerHtml\' attribute I don\'t have to worry about escaping (and failing to escape) the special characters. Also I can now edit the sign off thingy if I feel inclined. Or even put notes after it*. I just hope this posts to the database OK. It should since the form\'s fields are all labelled the same. In that sense I actually made that bit of the code quite well...in theory...

Imran Khan - 05/05/2014

*Like so!