技巧小總結

目錄:

1:點擊回車觸發提交按鈕 
2:獲取標籤中的style的內容 
3:獲取標籤中的class名稱 
4: noscript 
5: 當前頁面不被其他iframe包含,後臺退出登錄時可用 
6: struts的html:radio如何選中默認

內容

1:點擊回車觸發提交按鈕

function login_onkeyup(){ 
        key=window.event.keyCode; 
        if(key==0xD){ 
        document.forms[0].submit(); 
        } 
    }


2.獲取標籤中的style的內容

document.getElementById("divLeft").style.cssText;

3.獲取標籤中的class名稱

document.getElementById("divLeft").className;

4. noscript 
<noscript> <iframe src="*.htm"> </iframe> </noscript> 
noscript 元素用來定義在腳本未被執行時的替代內容(文本)。 
此標籤可被用於可識別 <script> 標籤但無法支持其中的腳本的瀏覽器。 
此段代碼意思爲如果瀏覽器不支持script的代碼,則會顯示嵌入的那個頁面的內容。 
5.當前頁面不被其他iframe包含,後臺退出登錄時可用

  方式1》 
         if (top.location != self.location){ 
             top.location = self.location; 
         }

  方式2》<meta http-equiv="windows-Target" contect="_top">強制頁面在當前窗口中以獨立頁面顯示,可以防止自己的網頁被別人當作一個frame頁調用; 
6:struts的html:radio如何選中默認

<html:radio  styleClass="width:20px;"   property="dynaProperty(SEIN_RESULT)"  value="成功" /> 
     成功&nbsp;&nbsp; 
<html:radio styleClass="width:20px;" property="dynaProperty(SEIN_RESULT)" value="失敗" /> 
      失敗

      document.all("dynaProperty(SEIN_RESULT)")[0].checked=true; 
      document.all("dynaProperty(SEIN_RESULT)")[1].checked=false;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章