Right constructor for Ajax call with requestOptions hash?

I'm have a real hard time getting a little Ajax modal working. Suggestions for correction appreciated. the contents function is getting called, but the fd parameter is null rather than having the string given in requestOptions.

Inside Event.observe(window load): Event.observe(window,'load',function(){ var m; $('mvrLast5').observe('click', function() { m = new Control.Modal($('mvrLast5'), {containerClassName: 'fd', requestOptions: {fd:'http://www.billsaysthis.com/movies?feed=rss2'}, contents: getFeedData(), iframe: true, overlayClassName: 'fd'}); m.open }); });

function getFeedData(fd) { do stuff and return string }

Inside the page is the click to open:

Pol Last 5

Posted April 25th, 2007 at 12:03am by BillSaysThis

requestOptions is the full hash that gets passed into Ajax.Request. My guess is that you want:

{requestOptions:{parameters:{}}}

Posted April 26th, 2007 at 9:26am by ryan

Maybe I didn't understand your answer sufficiently, since when the function specified in content is called the parameter is undefined according to Firebug. Here is the revised block:

$('mvrLast5').observe('click', function() { m = new Control.Modal($('mvrLast5'), {containerClassName: 'fd', requestOptions: {parameters: {fd:'http://www.billsaysthis.com/movies?feed=rss2'}}, contents: getFeedData(), iframe: true, overlayClassName: 'fd' }); m.open();

Posted April 26th, 2007 at 10:08am by BillSaysThis

  • bump? *

Posted May 10th, 2007 at 12:17pm by BillSaysThis

Login or Register to Post