During the recent project debugging, I found in firebug that EasyUI components always load the url attribute twice when they are loaded asynchronously.

During the recent project debugging, I found in firebug that the component of EasyUI always loads the url property twice when it is loaded asynchronously. The code is as follows:
1 $(function(){
2 $('#comb').combobox({
3 url: '/area/list'
4 });
5 });
6
7 <input id="comb" class="easyui-combobox" type="text" name="comb" />

You can see the page from the above code When initializing, load the url of the combobox component once
, and use the class to declare the combobox once in the html code, which leads to that when easyUI parses the html code, it first parses the combobox component in the class declaration, requests the url once, and then calls the initialization in js The code initializes the data once, resulting in repeated loading. The way to avoid it is to use only one initialization method to declare the easyUI component to avoid repeated submission requests. The
modified code is as follows:
1 $(function(){
2 $('#comb' ).combobox({
3 url:'/area/list'
4 });
5 });
6
7 <input id="comb" type="text" name="comb" />

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326615174&siteId=291194637