Popular Search : Javascript Substring Substr Difference