You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rrecoba <rr...@hotmail.com> on 2007/08/07 22:08:24 UTC

Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined

i have an ajax submit button that replaces the div specified by the targets
attribute with the result from an action, and the result returned by the
action has some javascript to be executed that uses the
document.getElementById(). 

I´ve read that this is a known issue (WW-1951) that will be fixed in v2.1.0.
How can i solve this problem while v2.1.0 is released.´

Thanks.
-- 
View this message in context: http://www.nabble.com/Ajax-submit-button-executeScripts%3D%22true%22-evaluates-javascript-before-DOM-elements-are-defined-tf4232440.html#a12041489
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined

Posted by Oleg Mikheev <mi...@bigfoot.com>.
rrecoba wrote:
> i have an ajax submit button that replaces the div specified by the targets
> attribute with the result from an action, and the result returned by the
> action has some javascript to be executed that uses the
> document.getElementById(). 
> 
> I´ve read that this is a known issue (WW-1951) that will be fixed in v2.1.0.
> How can i solve this problem while v2.1.0 is released.´
> 
> Thanks.

Define a function with your JS and execute it once page is loaded.
Try putting smth like
_container_.addOnLoad(function() {alert('hi');});
inside the result.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined

Posted by rrecoba <rr...@hotmail.com>.
Thanks for your help. I don´t understand your answer, can you explain me with
more detail?



mihel wrote:
> 
> rrecoba wrote:
>> i have an ajax submit button that replaces the div specified by the
>> targets
>> attribute with the result from an action, and the result returned by the
>> action has some javascript to be executed that uses the
>> document.getElementById(). 
>> 
>> I´ve read that this is a known issue (WW-1951) that will be fixed in
>> v2.1.0.
>> How can i solve this problem while v2.1.0 is released.´
>> 
>> Thanks.
> 
> Define a function with your JS and execute it once page is loaded.
> Try putting smth like
> _container_.addOnLoad(function() {alert('hi');});
> inside the result.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-submit-button-executeScripts%3D%22true%22-evaluates-javascript-before-DOM-elements-are-defined-tf4232440.html#a12054786
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined

Posted by Oleg Mikheev <mi...@bigfoot.com>.
rrecoba wrote:
> i have an ajax submit button that replaces the div specified by the targets
> attribute with the result from an action, and the result returned by the
> action has some javascript to be executed that uses the
> document.getElementById(). 
> 
> I´ve read that this is a known issue (WW-1951) that will be fixed in v2.1.0.
> How can i solve this problem while v2.1.0 is released.´
> 
> Thanks.

Define a function with your JS and execute it once page is loaded.
Try putting smth like
_container_.addOnLoad(function() {alert('hi');});
inside the result.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org