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


--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to