0

i'm going to send fileVO(java bean) to my js file. how to get this value from js?

model attribute from java.

   model.addAttribute("fileVO", fileVOListTmp.get(0));

and I need to get this value in javascript.

<script>
        var fileVO = $('#fileVO').val();
        alert(fileVO);

</script>

but it shows undefined

2
  • 2
    Possible duplicate of How to access model attribute in Javascript Commented Aug 23, 2017 at 0:52
  • what does the return output looks in DOM ? does the element has an Id of "fileVO" ? if not then it will never return the value that you are trying to get. Commented Aug 23, 2017 at 0:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.