Showing posts with label quotes. Show all posts
Showing posts with label quotes. Show all posts

Tuesday, 8 January 2013

HTML & CSS: common mistakes

   


Today we are going to see something half way between funny and serious: common mistakes we make while using HTML and CSS.

Why is it funny? Because sometimes those mistakes are so basic that when talking about them we usually react saying we don't make such mistakes. But then... when it happens, for any reason - even the most incredible - the only thing we can do is laugh. Mistakes are always just around the corner. The better we know them, the easier we are going to avoid them.

And when it happens... well... just have a laugh!

Wednesday, 23 March 2011

JavaScript: special characters

   


JavaScript code is full of special characters. When coding, you will end up using a lot of apostrophes, quotes and so on. Let me explain it through a simple example.
<script type="text/javascript">
document.write("John said "Cheers!" while raising a glass of wine.");
</script>
As you may noticed, in the above code we have a series of quotes. The first one is defining the starting point of the string we want to output, while the last one is the ending point. Just to be more clear, the red quotes are the boundaries of the text string, while the green ones should be part of the string itself. If we use the above code, an error will be the result, because the first green quote will be interpreted as the ending of the string. That is as if the string is cut like:
John said
leaving the rest
Cheers!" while raising a glass of wine.
out.
How to deal with that?

Wednesday, 19 January 2011

WordPress: ArrJS Random Quote and Testimonial Widget

   


With this quick post I just wanted to let you know that byBML created a WordPress plugin taking "inspiration" from my post jQuery: random quotes from a txt file.

This plugin creates a widget which will load random quotes or testimonials from a text file via JQuery.

The plugin can be found here.

Monday, 22 November 2010

jQuery: random quotes from a txt file

   


If you want to create random quotes, loading the text from an external file, jQuery and its GET command could be a simple a fast solution.
We can create a div tag that will be the target of the quote:
<table>
   <tr>
     <td valign="middle"><div align="right" class="quotes"></div></td>
   </tr>
 </table>