If I want to evaluate a JSF bean property from within JavaScript, I see that it works if the JavaScript snippet is inside the xhtml file, but doesn\'t work when the JavaScri
I just was want to check something before answer, like I said in my comment :
I think you can't from external JS, the only way as a workaround you need to pass that value to JS function from JSF page by calling it like functionName(#{value});
and do what you want in JS file like a normal JS value.
Like in your index.xhtml:
or like :
and in your js file:
function functionName(var1) {
// DO what you want to do with var1 or varN like normal JS value
}
Sure you can pass a multi-parameters not only single parameter.