The one caveat is that in order for LEMval('link') to work, you need to place {link} somewhere on the page. EM only provides access, via LEMval(), to variables it knows are being used on the page. Of course, you can hide the contents of {link} if you don't want to display it.

Alternatively, you can avoid using {link} and get the value via the SGQA code (e.g. window.open($('#java123X45X67'),'_blank')), but one of the goals of EM is to make it easier to port code across surveys without needing to re-name SGQA codes.