Search This Blog

Google Analytics

Tuesday, October 29, 2013

HtmlEncode and HtmlDecode In JavaScript

In web development, we often need to encode a string especially input from user so data with potential malicious intention when displayed will be safe. On server side, we can use e.g. HtmlUtility.HtmlEncode (in ASP.NET for encode) and HtmlUtility.HtmlDecode (in ASP.NET for decode).

What if we need one in JavaScript? Here's how to do just that!

<script src=""></script>

<script language="javascript" type="text/javascript">
    function htmlEncode(value) {
        return $('<div/>').text(value).html();

    function htmlDecode(value) {
        return $('<div/>').html(value).text();

    var s = "<b>hello's world</b>";
    var encoded = htmlEncode(s);
    var decoded = htmlDecode(encoded);


Sunday, October 27, 2013

How to give your Web apps a real speed boost?

Few tips published on the The Next Web on how to speed up your website and making sure user experience is not impacted especially on mobile.

  1. Check for unnecessary or oversized images
  2. Don't ignore Android
  3. Consistent measurement
  4. Multitask

The article also introduced a few tools to get you started.

Monday, October 14, 2013

Sunday, October 06, 2013

Use Google Analytics to Track Outgoing Gmail Messages

Very creative use of Google Analytics to track outgoing Gmail messages.

Generate VCard as QR Code Using Google Docs

Should you have lots of contacts to be imported into your phone, it can get pretty time consuming to input one at a time. One time saving tip is to have them entered into a spreadsheet and have them converted into VCard format. Google Docs does have a feature to generate VCard as QR Code which you may then use any QR Code reader to read them.

This article demonstrates exactly just how to do that.

A quick summary:
  1. Create a new Google Spreadsheet

  2. Setup 5 columns i.e. First Name, Last Name, Phone, Contacts, QR Code.

  3. First 4 columns should be self-explanatory. As for the last column, it shall be a formula to generate QR Code. Copy and paste below formula.

    =image("" & A2 & "%20" & B2 & "%0ATEL;CELL:" & C2 & "%0AEMAIL:" & D2 & "%0AEND:VCARD")

Hope it helps.

What is "Exit Rate" and "Bounce Rate"?

Exit rate

The number of times a visitor leaves your domain from a page, divided by that page’s total views. Generally expressed as a percentage.

Bounce rate

The number of times a visitor enters a domain on a page but leaves before viewing any other page in the domain, divided by the total number of views of that page. Also generally expressed as a percentage.

Popular Posts