About the js execution sequence code: & lt; inputtypebuttononclick & quot; a (); B () & quot; & gt;, click the button to Execute method a () in js () and B (). how can I implement it if I want Method B () to wait until method a () is executed. (Method a () is actually the method called by ajax. Method B () execution requires the return value of method a () ------ solution ---------- about the js execution sequence
Code: , Click the button to execute methods a () and B () in js. how can I implement it if I want Method B () to wait until method a () is executed and then execute. (Method a () is actually the method called by ajax. Method B () execution requires the return value of method)
------ Solution --------------------
Put B () in if (xmlHttp. status = 200) of.
------ Solution --------------------
Put function B () at the end of function!