I have two change event handlers for a selected elemet. Let's call the Func1 and Func2 functions. When I initialize these handlers, I do funk 1 and then, but when there is a change event in select entry, throw 2 is called before Funk 1.
Is there any way to prioritize these two tasks? Just to let you know that the initial script is in separate scripts for each function.
This is the layout of my code
Script1:
$ (select "# myDropdownlist"). Change (function () {$ (this) .parents ('form: first'). Submit (); // submit form to post request to update an object which is in session} < / Pre> script 2:
$ ("# myDropdownlist select"). Change (function () {Send an AJAX request and in the script 1 function based on changes instead of Jason result Object} although I started them with sequence, but this is the function Do not call the sequence in sequence because it first calls Func2, the object is not updated yet, so the result is not correct, it will then call Func1 and the object will be updated which is too late Because Phonk 2 has already removed the result based on the previous version of the object.
Please also keep in mind that the script 1 is very common and it can be any form data entry The page where the script 2 is specific to a specific p is the age and I want to do an extra thing, once the selected element changes only in one page. This means that I can not call Funk 2 inside Funk 2.
Any help would be highly appreciated
Regards
Behnam Divsalar
Simple reply to function after an event will need to add a single event handler function, which runs 2 function after the second.
$ ("# myDropdownlist Choose"). Change (function () {callFirstFunction (); callcandexoxfunction ();}
Comments
Post a Comment