JSF bean property not evaluated in external JavaScript file

后端 未结 4 590
终归单人心
终归单人心 2021-01-16 10:19

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

4条回答
  •  粉色の甜心
    2021-01-16 10:44

    Thanks to the suggestion by @Al-Mothafar, I have finally solved my issue in the following way:

    index.xhtml

    ...
    
                
    
    

    MyJS.js

    $(document).ready(function() {
        alert(myBeanProperty);
    });
    

提交回复
热议问题