Fix errant XHR request happening on every page

The check of the jquery selector by name will always return a
non-null object even if the object does not exist on the page,
the check needs to make sure the object returned doesn't
contain any items.

Change-Id: I51367547a37a2ee72ed300853d35d3cc6d89df7d
Fixes: bug #1132588
Merge "Fix errant XHR request happening on every page"