It may not be as elegant as the solution suggested here, but I got it to
work by wrapping the Ajax.Updater in a function called by onsubmit and
placed in the main page.
But, I still would like to know how to have evalScripts:true work.
bill
bill wrote:
> I download a html fragment to a div using this script, which works fine.
>
> function fetchMessage(message_id, evt) {
> stopBubble(evt);
> url = 'mail/getmessage.php?n=' + message_id;
> new Ajax.Updater('showMessageDiv',url , {method: 'get',evalScripts:
> true} ); // get the requested message
> }
>
> I need to include a script in the page loaded by url
> I tried this way of using evalScripts but it does not download the
> script afaik.
>
> this is the script:
>
> <script type="text/javascript">
> $('messageProcessForm').observe('submit',function(event) {
> new Ajax.Updater('showMessageDiv', 'mail/process_message.php', {
> parameters: $('showMessageDiv').down('form').serialize(true),
> onFailure: function(response) {
> alert ("mail.js: failure to submit form - getmessage");
> }
> });
> Event.stop(event);
>
> })
> </script>
>
> I was going to put the script in the main body, but that won't work
> because messageProcessForm does not exist until the div is loaded. \
>
> Issue #2:
> As this is a script that is watching, it is not a function so I am not
> sure how to have it be included in the page, or do I need to do that
> as it is not a function ?
>
> --
> Bill Drescher
> william {at} TechServSys {dot} com
>
> >
--
Bill Drescher
william {at} TechServSys {dot} com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---