There are fewer documents related to synchronous calls. The following is a synchronization example, that is, when the page is loaded, or when this js is called, the program will go down line by line, which is used for some functions such as obtaining data or styles required for page initialization.
Sample code:
//Determine button permissions method. true means no permission, false means permission can be displayed
function checkButton(buttonId){
//The status of the button, ext has higher requirements on types, so pay attention to the conversion of types and variables.
var state = new Boolean(true);
//What is called here is the synchronous method of ext, which should be distinguished from the asynchronous call
var conn = Ext.lib.Ajax.getConnectionObject ().conn;
//The second parameter is the address requested from the background. The output data of the requested background method is: conn.responseText data
conn.open("get", '/base/business /SysPublicAction.do?operate=checkButtonsState&buttonId=' buttonId,false);
conn.send(null);
//conn.responseText is a string type
//The string cannot be assigned to state. So here we can only judge the characters to change the state
if(conn.responseText=="false")
state = new Boolean(false);
return state.valueOf();
}