[wp-hackers] widget select field problems?

Andrew Ozz admin at laptoptips.ca
Thu Aug 6 20:50:36 UTC 2009

Stephanie Leary wrote:
> ... I'm not sure what I just disabled. :/
> In widgets.dev.js, line 196, I changed
> $('.widget-content', widget).html(r);
> to
> $('.widget-content', widget).html;
> ... and my select boxes display correctly. But I'm having trouble
> backtracking the origins of r... where did it come from, and what was it
> supposed to do?

The "r" is the html returned from the ajax call, it comes from line 171. 
  Basically this line

$('.widget-content', widget).html(r);

says: find "widget-content" inside "widget" and replace all the html 
there with "r". Removing "r" triggers an error on this line (that is 
suppressed by jQuery) and doesn't replace the widget's inner html with 
the ajax return, so you see the initial widget not the updated one.

You can see what "r" is set to in Firebug's console with 
"console.log(r);" just above line 196. If this looks ok perhaps try 
disabling any custom js on the widgets page. If it doesn't, perhaps 
tweak the output from Your_Widget_Class::form() or the 
Your_Widget_Class::update() to see what triggers this.

More information about the wp-hackers mailing list