Dont throw javascript errors with invalid anchor

Change-Id: I872b17ed5e2be8cde0fe20b910ed14ff1c951a83
Merge "Dont throw javascript errors with invalid anchor"