Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Ajax based actions cause js errors with synchronous calls

#727

The docs describe If you for some reason or another need synchronous processing (that‘ll block the browser while the request is happening), you can specify options[:type] = :synchronous.

If I make a call to any helper aka drop_receiving_element with type => :synchronous, the asynchronous is set as expected, but an additional argument type:synchronous is added.

Droppables.add("drop_zone", {onDrop:function(element){new Ajax.Request('/containers/dropped', {asynchronous:false, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}, type:synchronous}

This causes a js error since synchronous isn't defined as a JS variable. Alternate variations of :synchronous => true or :asynchronous => false don't work, although the docs don't say they should anyway.

Reported by Niels Meersschaert · July 30th, 2008 @ 03:18 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Emilio Tagua
  2. Emilio Tagua
    Emilio Tagua
    • Tag changed from 2.1, helper to 2.1, helper, patch

    I attach a patch that fix this and a few test to verify helpers are generated with the option "asynchronous" as expected.

    July 31st, 2008 @ 08:12 PM

  3. josh
    josh
    • State changed from new to stale

    Staling out, please let me know if its still an issue.

    November 22nd, 2008 @ 07:52 PM

  4. Emilio Tagua
    Emilio Tagua

    Hey Joshua,

    I think is still an issue if the type can't be specified.

    November 23rd, 2008 @ 12:20 AM

  5. Emilio Tagua
    Emilio Tagua

    Josh, I was looking at the source and the patch seems to be already applied, i think you can change the state to "solved".

    November 23rd, 2008 @ 01:05 AM

  6. josh
    josh
    • State changed from stale to resolved

    thanks

    November 23rd, 2008 @ 06:32 AM