Popular Search : Javascript Check If Scope Exists