Prototype function inside of jQuery function

104 Views Asked by At

Is it possible to load a Prototype function within a JS function? I have the following code and I'm not sure that it'd work, but if it would, how would I go about triggering the function to actually execute when the if statement is true?

if ((jQuery("div.amfinder-horizontal td:nth-child(1) select").val() == "0")) {
    jQuery("div.amfinder-horizontal td:nth-child(1) select option").each(function() { this.selected = (this.text == yearSelected); });
    jQuery("div.amfinder-horizontal td:nth-child(1) select option").change();

    function myFunction()
    {
        $$('finder-72--424').simulate('click');
        $$('finder-72--424').simulate('change');
    }

}

As for proper coding technique, I know the function should be outside of the if statement, but I just put it there to demonstrate what I'm trying to do. :-)

Thanks!

0

There are 0 best solutions below