var xData = ${_attrValues};
So I tried using "${}" in external js file but it throws this error ->
You can not access it via an External Javascript file,because an external Javascript file do not know the context,you must need to import it to a JSP or Velocity file,then you need use sessionScope to retrieve the session variable,try it like below:
var xData = "${sessionScope._attrValues}";