$USES conflict resolution when importing extjs and jquery files

  • 2020-03-30 01:22:04
  • OfStack

1. During the recent project, if the jquery file is not imported into the HTML page, it can be saved normally, but after importing the jquery file, it cannot be saved

After debugging, it was found that the imported jquery file was in conflict with the existing extjs file (because of the $sign conflict).

There is a conflict between jQuery and ExtJS, but it is ok in the non-ie kernel, because of the $symbol conflict, the solution is to replace the $symbol of jQuery with other, the code is as follows:

 
<script type="text/javascript" src="js/jquery.js"></script> 
<script type="text/javascript"> 
var jq=jQuery.noConflict(); 
</script> 
<script type="text/javascript" src="js/ext.js"></script> 

When an HTML page is invoked, it looks like this :(using the jq defined above instead of the $sign)
 
function a(){ 
jq("#SARYXX_XM").jSuggest({ 
url: "../../ftdxxglxt/highchart/jsp/autoFind.jsp", //The processing page to send to
type: "GET", 
data: "sary_xm" , // parameter  
autoChange: true 
}); 
} 


Related articles: