Script tag Order of execution is not correct In below Ext. JS code
<!DOCTYPE html>
<html>
<head>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css"
rel="stylesheet" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script type="text/javascript" defer>
Ext.onReady(function () {
Ext.create('Ext.Panel', {
renderTo: 'testId',
height: 200,
width: 600,
title: 'Normal Panel',
html: 'Normal Panel Html'
});
});
</script>
<br />
<script type="text/javascript" defer>
Ext.onReady(function () {
var childPanel_1 = Ext.create('Ext.panel.Panel', {
title: 'Panel in Container',
html: 'Panel in Container html',
width: '35%',
});
Ext.create('Ext.container.Viewport', {
renderTo: Ext.getBody(),
items: [childPanel_1]
});
});
</script>
</head>
<body>
<div id="testId" />
</body>
</html>
Could someone help me out here, how I could preserved the order of script tags. Also the reason, why it is happening so.