Home > front end > Js document. The work is finished loading such as executed, but in front of the library to read data
Js document. The work is finished loading such as executed, but in front of the library to read data
Time:01-30
The following lines of code, is to do the autocomplete, to finish the SQL the read to make automatic, but there are thousands of data in SQL, I tried, if read only 200 or so, this can be done automatically (Alert is used to test the js ever execute), But if amplified to article 500, or all of the data, this is totally not perform, Didn't ready state estimation is the dom, so did not perform, What method can solve this problem?
Var: supplier="& lt; ? PHP echo ($supplier_tmp); ?>" The split (", "); //the document. The write (" fsdfadf "+ : supplier [0]). $(" # customer_id "). The autocomplete ({source: : supplier}); Alert (" hello "); Alert (document. The readyState);
} ); </script>
CodePudding user response:
Jump out of the code logic, the code does not perform may have two kind of situations: 1. The code before executing an error, cause the interruption to the execution of the current code 2. Code before executing judgment statements, statement cleared expected to execute the code
The code does not perform so two kinds of circumstances, which come of it?
CodePudding user response:
Is the DOM ready finished loading is executed, you may well before you return of data, that is your data haven't returned the function has been performed,
CodePudding user response:
Check the front there is a poem, the name of a table column content, Check all does not perform, 200, Not change to 500, No other changes