The following code simulates the selection of options from a select element
and firing the change event after.
--------------------------------------------------------------------------------------------------
var selectElementA=jQuery('#ctl00_pageContentRegion_frameManufacturer');
var options = selectElementA.find('option').slice(1).toArray();
var delay=5000;
jQuery(document).ajaxComplete(function complete(e){
var option=options.shift();
if (option){
option.selected=true;
jQuery(function(){
setTimeout(function(){selectElementA.trigger('change');},delay);
});
} else{
jQuery(document).unbind('ajaxComplete',complete);
}
}).trigger('ajaxComplete');
--------------------------------------------------------------------------------------------------
I run the script in the firebug console and it works (checked for
http://www.wrenchscience.com/ ).
Then I make some changes (as follows) and use the script in my firebug
extension, but it is not working there.
It only selects the first option from the select element without firing the
change event and then stops working. Seems ajaxComplete is not firing for
the second time.
--------------------------------------------------------------------------------------------------
var selectElementA=jQuery('#ctl00_pageContentRegion_frameManufacturer',
context.window.document);
var options = selectElementA.find('option').slice(1).toArray();
var delay=5000;
jQuery(context.window.document).ajaxComplete(function complete(e){
var option=options.shift();
if (option){
option.selected=true;
jQuery(function(){
setTimeout(function(){selectElementA.trigger('change');},delay);
});
} else{
jQuery(context.window.document).unbind('ajaxComplete',complete);
}
}).trigger('ajaxComplete');
--------------------------------------------------------------------------------------------------
I am using FF 22.0 and FB 1.12.0b2.
What should I do to get it working?
I would appreciate any help on this problem.
Ebrahim
--
You received this message because you are subscribed to the Google Groups
"Firebug" 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 http://groups.google.com/group/firebug.
To view this discussion on the web visit
https://groups.google.com/d/msgid/firebug/e5a859b6-1fa8-4d17-a9e2-5932b931c291%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.