[UPHPU] run javascript inside ajax php

Merrill Oveson moveson at gmail.com
Mon Dec 13 15:47:44 MST 2010

What is the event that is triggered when a php file in loaded from ajax.

All I need is an event.

This works:  print "<input onclick=\"displayExpiration('y')\"
type=\"radio\" name=\"licenseExpires\" value=\"1\"

It calls displayExpiration() which is present on the php file calling
creating the ajax php file.

On Mon, Dec 13, 2010 at 3:27 PM, thebigdog <bigdog at venticon.com> wrote:
> On 12/13/10 2:55 PM, Merrill Oveson wrote:
>> UPHPUers:
>> I have a php file that calls a 2nd php file via ajax.
>> How do I run javascript in the 2nd php file.
>> This statement doesn't work:
>> <script language="Javascript" type="text/javascript">
>> alert("test");
>> </script>
>> I've tried eval - still no love.
>> What I can do is call a javascript function from the 2nd php file but
>> only if I use an event. e.g.
>>    print "<input onclick=\"displayExpiration('n')\" type=\"radio\"
>> name=\"licenseExpires\" value=\"0\">";
> JavaScript does not run on the server side (unless you have JavaScript engine -
> probably not what you want). In your case you can return results from the 2nd
> page that can be used in JavaScript ajax call on the first php page to set your
> radio buttons.
> thanks,
> --
> thebigdog

More information about the PLUG mailing list