java - Inserting Struts Tiles attribute into a JavaScript function -


I am trying to insert a string tile attribute in a JavaScript function. The JS function is called on load and some JSP pages should be allowed to add additional code to that function.

The template looks like this:

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; Funnel ONLOG () {... & lt; Tiles: insert = attribute = "html.head.onLoad" = "true" /> ...} & lt; / Script & gt; & Lt; / Head & gt; & Lt; / Html & gt;  

and the JSP site applies this template to:

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; & Lt; Tiles: put type = "string" name = "html.head.onLoad" & gt; Document.getElementById ("Report"). Style.height = (getWindowHeight () - 200) + "px"; & Lt; / Tile: put & gt; ... & lt; / Script & gt; & Lt; / Head & gt; & Lt; / Html & gt;  

Unfortunately, the specialty is not added to the JS function, but somewhere in the HTML head.

Do you know in a way that how can I achieve my goal?

JS runs on client side, not on server side Tiles run on server side, not on client side. In other words, they do not run in sync because you expect your coding effort. The server prepares the HTML / CSS / JS code on the basis of server side taglibs and then sends it to the client side.

You have to solve it on server side because the goal is a bit unclear and I do not have strokes / tiles, so I can not go into detail. But now you should at least understand the cause of the problem. See also for more insights.


Comments