On Nov 14, 3:45 am, Robert Zotter <[EMAIL PROTECTED]> wrote: > Ehsun, > > Can you post some code so we can get a better understanding of what > you are trying to accomplish. > > Off the top of my head though it sounds like you may want to look into > scope > binding.http://www.prototypejs.org/api/function/bindhttp://www.prototypejs.org/api/function/bindAsEventListener > > -- > Robert Zotter > Zapient, LLC > Ruby on Rails Development and Consulting > > http://www.zapient.comhttp://www.fromjavatoruby.com > > On Nov 13, 1:39 pm, Ehsun <[EMAIL PROTECTED]> wrote: > > > I've create an Object in my pages script tags, something like this: > > > a = new A(); > > > and when I want to call a method of a in the script which is actually > > the ajax content (evaluated with .evalScripts) everything is fine. but > > when the creation and the calling code, both are in the ajax contents > > (seperate requests) which are evaluated! the second script (calling > > script) has no access to the object!!! > > > What should I do?
I have 2 classes: AjaxTab and AjaxForm AjaxTab uses Ajax.Updater to fetch ajax content to the page and AjaxForm is uses Ajax.Request to Ajaxify the process of posting a HTML form. When I write the following code in my page: <form id="someId"> ... </form> <script> var af = new AjaxForm("someId", "callback.php"); </script> And this code in my serverside, callback.php echo "<script>af.showMessage('wrong data!', '#ff0000');</script>"; if works fine! But If I fetch the first portion of code to the page by means of AjaxTab, then the script af.showMessage() will fail since the object af will not be recognized!!! --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---