Fix Bug: Template Tab Broken in Chrome due to Code Error

String.prototype.startsWith is a Firefox-specified API and Chrome doesn't
support it. Replace it with a generic method.

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>