[support] AHAH 403 error

Doug doug.duboulay at gmail.com
Thu May 13 06:50:31 UTC 2010


Just re-reading through the AHAH section of "Pro Drupal Development".
The only AHAH attribute that comes close to actually specifying a
client-side javascript function to be invoked is "method", which must take
a value of iether "append", "before","prepend" or "replace" and then
the javascript jquery itself is (from misc/ahah.js) 

if (this.method == 'replace') {
  wrapper.empty().append(new_content);
} else {
  wrapper[this.method](new_content);
}

I looked at this once before and decided that AHAH seemed to be only useful 
for animating form elements themselves, or modifying the "wrapper" around 
the form element (but its quite possible I was wrong about that - maybe 
there is a black-art to generating special "new_content" JSON in your 
MENU_CALLBACK?).

My AJAX use case was for for getting events and injecting them into a
javascript (jquery) calendar (not drupal related) embedded in a 
drupal menu "page callback". I ignored AHAH altogether and just used
jquery's AJAX function directly - activated by an onclick attribute 
attached to a handrolled button (to avoid the every-button-is-submit
bug).

Cheers
Doug



On Thu, 13 May 2010, Scott wrote:
> Quite honestly it would seem I just don't know enough about drupal
> development or jQuery yet.  I've generally been able to figure out how
> to do things by studying existing code that seems to do what I'm after.
> In this case I haven't found (or probably just not recognized) examples
> of what I wish to do.  I'd be happy to package up my module as it stands
> and send it to anyone interested.  I don't have a javascript function
> yet as I don't know enough about how to use jQuery.  I have a form with
> fields for "what to look for" and "where to look for it" as well has
> hidden value fields for publisher_id and api_key.  If I don't use the
> #ahah attribute but use the submit_handler function I can get a url that
> can fetch the xml or json from the remote server.  The url works if I
> clip it and enter into the address bar of the browser.  The url does not
> work as input into drupal_http_request().
>
> By the way, it's no longer a 403 error but only a general error.  I had
> thought that if hook_menu got the correct argument the page callback
> function could contain any code, even just displaying "Hello World...".
>
> Thanks for all the help so far...
>
> On Thu, 2010-05-13 at 10:32 +1000, Doug wrote:
> > On Thu, 13 May 2010, Scott wrote:
> > >  What I can't seem to do is get the
> > > submit button to work correctly.
> >
> > can you post the snippets of FORMS API code where you generate the
> > button, the generated html containing the button, and possibly the
> > javascript code that is supposed to be called?
> >
> > Assume you're testing with firefox web developer plugin and looking at
> > the error console?
> > Explorer seems to always want to debug from a certain line number too.




More information about the support mailing list