I’m using struts2 and have this code that triggers after an action is performed (via Ajax):
dojo.event.topic.subscribe("cambioProyecto", function() {
var hola = json_entregables;
alert("hola");
}
The *json_entregables* variable is a parameter given via struts2. I can access it in the jsp, no problem. But i can’t in the script. What is the problem?
I figured out a way to gat what I wanted but it’s rather unclean. Since the anonymous function is a callback function from the Ajax process, I captured the response by defining a parameter for the function. That response is a string with the actual html of the response.
Now, to access the parameter, i have to include its value inside the jsp as a hidden element. Like this:
Then, i got it through jquery like this:
Anyway, i don’t think it’s a good way to do it so i wouldn’t recommend it. But it worked for me. Thank for the support.