that is the html code I do send after an ajax.updater call.
-----------------
<div id="parent">
<div id="the_id_xyz" >
here html
</div>
<script type="text/javascript">
getData=function(){
  return {id:'the_id_xyz',some_more_data:'data data data'};
}
</script>
---------------------

further I do have my ajax updater like build laike this

function myUpdateFunc (){
     var myAjax = new Ajax.Updater(
     'parent',
     url,
     {
         method: 'get',
         parameters: pars,
            insertion:Insertion.Bottom,
            onComplete:registerHtmlCode
            evalScripts: true
     });
}
and somwhere else

function registerHtmlCode(){
  var newData=getData();

  ... do some more funny things with the newData
}

from prototype API doc:
"The local scope will be that of Prototype's internal processing
function. Anything in your script declared with var will be discarded
momentarily after evaluation, and at any rate will be invisible to the
remainder of the page scripts."

So believing this I do get by the first call to myUpdateFunc the
callback function do get the correct data out of the getData function.

The second time a call myUpdateFunc the value I do get back out of
getData is the data corresponding to the first call. My reading of the
doc let me think that once the getData is reevaluted the value should be
the value send with the html code.

I want to have with the call to getData() some info about what I just
inserted, this without having to query my DOM.

Is my reading of the doc correct. Has this construct some chances to work.

Thanks for any explanation, hint, remarks

cedric


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to