今天要實現一個後臺查詢數據後顯示在前臺的一個程序,需求以下:數據庫
後臺查詢數據庫獲得返回記錄的條數,前臺用JS找到這個數據而後作出判斷返回對應的頁面。數組
技術要點:less
1. 數據的容器ide
頁面放置一個hidden控件用來存放記錄數據。命名爲iCount。server
<INPUT type="hidden" id="iCount" name="iCount" runat="server">文檔
2. JS如何獲得後臺的數據字符串
JS使用:document.getElementById("iCount").value獲得。get
3. 窗口頁面的寫法it
彈出窗口的寫法:class
window.showModalDialog("URL",window,"dialogHeight: 450px; dialog; center: Yes; help: yes; resizable: no; status: no;");
頁面跳轉的寫法:
window.navigate("URL");
技術拓展:
window.showModalDialog()方法用來建立一個顯示HTML內容的模態對話框。
window.showModelessDialog()方法用來建立一個顯示HTML內容的非模態對話框。
使用方法:
vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
參數說明以下:
sURL--必選參數,類型:字符串。用來指定對話框要顯示的文檔的URL。 vArguments--可選參數,類型:變體。用來向對話框傳遞參數。傳遞的參數類型不限,包括數組等。對話框經過window.dialogArguments來取得傳遞進來的參數。 sFeatures-- 可選參數,類型:字符串。用來描述對話框的外觀等信息,能夠使用如下的一個或幾個,用分號「;」隔開。 1.dialogHeight :對話框高度,不小於100px,IE4中dialogHeight 和 dialogWidth 默認的單位是em,而IE5以上是px,爲方便其見,在定義modal方式的對話框時,用px作單位。 2.dialog 對話框寬度。 3.dialogLeft: 離屏幕左的距離。 4.dialogTop: 離屏幕上的距離。 5.center: {yes | no | 1 | 0 }:窗口是否居中,默認yes,但仍能夠指定高度和寬度。 6.help: {yes | no | 1 | 0 }:是否顯示幫助按鈕,默認yes。 7.resizable: {yes | no | 1 | 0 } 〔IE5+〕:是否可被改變大小。默認no。 8.status: {yes | no | 1 | 0 } 〔IE5+〕:是否顯示狀態欄。默認爲yes[ Modeless]或no[Modal]。 9.scroll:{ yes | no | 1 | 0 | on | off }:指明對話框是否顯示滾動條。默認爲yes。 下面幾個屬性是用在HTA中的,在通常的網頁中通常不使用。 10.dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印預覽時對話框是否隱藏。默認爲no。 11.edge:{ sunken | raised }:指明對話框的邊框樣式。默認爲raised。 12.unadorned:{ yes | no | 1 | 0 | on | off }:默認爲no。