Hi all;

I have a quick question about using a preamble on a call to 
hobo_ajax_response. 

On a form, I have a <select> which is bound to a javascript function when 
it changes:

    $("#ctl_select").change(lts.updateDocumentFields);

In a controller, I have an unrelated *web method* that needs trigger this 
same function call when it's done. So, I thought I'd do this:

  def my_web_method
    ...
    ...
    js="lts.updateDocumentFields();"
    hobo_ajax_response( :postamble => js )
  end

While this actually works and does the job, it leaves an "ajax failed" 
message in the Chrome console. 

Instead, I find I've had to do the following to avoid the "ajax failed" 
message, but it feels more like a hack:

    # Trigger the change event manually to get updateDocumentFields to fire:
    js="$('#ctl_select_nature').change();"
    hobo_ajax_response( :postamble => js )

Anyone have an idea what the origin of the "ajax failed" message would be 
when I make a direct call to that javascript function instead of via the 
bound event? 

Any insight would be great.

Thanks!
Tim



-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to