Check for link existence in JS

Per Krinkle

Change-Id: Ie9484756d2e591b8dba146f73442ca5f3d5a327b
Merge "Check for link existence in JS"