1
我有一個ExtJS MessageBox,我甚至想在整個頁面加載前顯示,但除非我在Ext.onReady中寫入,否則它不會顯示加載。我該如何使它工作。我不能顯示ExtJS Message.Box,除非我使用Ext.onReady
這是我的代碼(我想用):
<html>
<head>
<title>Sorry</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="ext-all.css" />
<script type="text/javascript">
Ext.MessageBox.show({
msg: 'Activating your account, please wait....',
progressText: 'Authenticating E-Mail address',
width: 300,
wait: true,
waitConfig: {interval: 200}
});
</script>
</head>
<body>
</body>
</html>
<%
String UUID = request.getParameter("uuid");
userOperation UA = new userOperation();
UA.activateUser(UUID);
%>
<script type="text/javascript">
Ext.MessageBox.hide();
Ext.Msg.alert('Welcome', 'Your account has been activated, You can now login');
</script>
現在,這是什麼在起作用:
<html>
<head>
<title>Sorry</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="ext-all.css" />
<script type="text/javascript">
Ext.onReady(function() {
Ext.MessageBox.show({
msg: 'Activating your account, please wait....',
progressText: 'Authenticating E-Mail address',
width: 300,
wait: true,
waitConfig: {interval: 200}
});
)};
</script>
</head>
<body>
</body>
</html>
<%
String UUID = request.getParameter("uuid");
userOperation UA = new userOperation();
UA.activateUser(UUID);
%>
<script type="text/javascript">
Ext.MessageBox.hide();
Ext.Msg.alert('Welcome', 'Your account has been activated, You can now login');
</script>
但上面的代碼將在MessageBox在無限循環,因此打破了框的目的,我只需要框出現,直到我的頁面中的Java代碼被執行。所以如果MessageBox在頁面加載後呈現,那麼沒有任何目的。
但是在完成頁面加載後調用onReady時,我希望在瀏覽器到達MessageBox代碼的末尾「})」之前立即顯示單個MessageBox,直到「Java」部分完成其執行,這足夠公平。有辦法做到這一點,但不幸的是我無法弄清楚。 –
它基本上是相同的,因爲ExtJS需要寫入文檔,所以它需要準備好....最好的我可以推薦的是從一開始就創建標記。 – sra