I think I know what is going on

in the first example - everything runs as normal and nothing happens
because you are just declaring a function in the external script - the
function is not called - plus getLottoNumber() is not defined

the second example you are requesting a javascript file - but are sending a
html snippet, <script> blocks are not in js files


my opinion is you can clean this up alot by moving the function to the same
page and using more of the prototype utilities
I put a jsfiddle with my changes together for you - I changed out the
getLottoNumber() with random number so that it would work - let me know if
this makes sense

http://jsfiddle.net/FPBkA/

Jason Westbrook | T: 313-799-3770 | [email protected]



On Fri, Jul 27, 2012 at 7:46 AM, Phil Petree <[email protected]> wrote:

> then perhaps we're not understanding what you mean by "passed"
>
> normal process is:
> onSuccess: call a function that processes the incoming data
> onFailure: tell the user what happened
>
> what gets "passed" is data.
> what gets "called" are functions.
>
> having code in an external file indicates to me you want to call a
> function.
>
> I think a little more clarity might help us help you.
>
> On Fri, Jul 27, 2012 at 10:21 AM, Jim Longo <[email protected]> wrote:
>
>> Thanks for your response. I'm sorry, I forgot to mention I had tried
>> that.  The request is successful (as I mentioned I can pass html and php,
>> just not javascript)
>>
>>
>> On Friday, July 27, 2012 7:35:11 AM UTC-4, ppetree wrote:
>>
>>> Try using the onsuccess on failure parameters in Ajax updater.
>>>
>>> onFailure: function() {alert("bombed");},
>>> onSuccess: ...
>>> On Jul 27, 2012 12:04 AM, "Jim Longo" wrote:
>>>
>>>> If it helps, I can replace the js with something real simple (an alert)
>>>> and it still won't run in the AJAX page.  If I put plain text or html or
>>>> php in the external file it will run, but not javascript.
>>>>
>>>>
>>>>   --
>> You received this message because you are subscribed to the Google Groups
>> "Prototype & script.aculo.us" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/prototype-scriptaculous/-/3bfU0S4hsnQJ.
>>
>> 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.
>>
>
>  --
> 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.
>

-- 
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.

Reply via email to