Extract JSTL value from a list in to javascript variable -


I have an issue where I am doing this:

  & lt; Script & gt; Var calculation = 1; TravelExpense.value = '& lt; C: out value = "$ {customerPO.roleList ['' count + '']] travel trip] /> '; & Lt; / Script & gt;  

But I am unable to add a "count" JS variable with JSTLtag. It says that the unverified & lt; C: out I am unable to write the correct syntax for it

"post-text" itemprop = "text">

You are missing the second ending character:

  & lt; Script & gt; Var calculation = 1; TravelExpense.value = '& lt; C: out value = "$ {customerPO.roleList ['' count + '']] travel trip] /> '; // here ^ & lt; / Script & gt;  

Update has updated the count :

  & lt; Script & gt; Try to avoid quotes that go around. Var calculation = 1; TravelExpense.value = '& lt; C: out value = "$ {customerPO.roleList [\ '+ + counts" ""]. Travel travel) "/> & gt; '; & Lt; / Script & gt;  

This creates the following string:

& lt; C: out value = "$ {customerPO.roleList ['1']. Travelexpence}" / & gt;

On the one hand, are you sure that 1 should be cited? If roll list is an array, then it should work:

  travelExpense.value = '& lt; C: Out value = "$ {customerPO.roleList ['+ count +'] .travelExpense}" /> ';  

give:

& lt; C: out value = "$ {customerPO.roleList [1] .travelExpense}" />


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -