PHP Classes

exec js after ajax

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  exec js after ajax  >  (Un) Subscribe thread alerts  
Subject:exec js after ajax
Summary:problel with executing custom js function after ajax reponse
Messages:2
Author:kiril botev
Date:2007-05-26 09:16:23
Update:2007-05-26 19:58:59
 

  1. exec js after ajax   Reply   Report abuse  
Picture of kiril botev kiril botev - 2007-05-26 09:16:23
I try to do this on the server side
$message['Actions'][] = array(
'Action' => 'Command',
'Command' => "my_function();",
'Content' => ''
);

but i receive js error: my_function is not defined
Where is the problem ?

  2. Re: exec js after ajax   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-05-26 19:58:59 - In reply to message 1 from kiril botev
The actions that you define as AJAX response are only available until the response is finished. Then the iframe is unloaded to save memory.

For what you want, I suggest that you define a DIV in the page and make the AJAX response replace the DIV contents with HTML tags that include the code you want to load in the page.

You may also want to take a look at the ONCOMPLETE event actions.