ie與ff兼容性調試

1、ie與ff空格長度不一樣

2、ff如果沒有嚴格按照<td></td>這樣閉合,如多寫了</td>不會報錯,但在ie中很有可能什麼都不出來

3、ff中js中,如多了個逗號,不會報錯,但ie會出現js錯誤

4、ie中傳遞參數,前臺的""或null會在後臺轉換爲"null",而ff不會,故需處理

  後臺可以 !"null".equals(gradeId_str)

  對於null與“null”放入map中結果等效


Map<Object, Object> map = new HashMap<Object, Object>();
		map.put("we", null);
		
		String organizationId_str = "null";
		if (StringUtils.isNotBlank(organizationId_str) ) {
			map.put("organizationId", organizationId_str);
		}
		System.out.println(map);

{organizationId=null, we=null}

5、ie中隱藏顯示錶格的jquery實現方式

function showOrHidden(id,type,obj){
	var table= $("#"+id); 
	table.toggle();
	if(table.css('display') =="none"){
		obj.html("<strong>︾</strong>");
	}else{
		obj.html("<strong>︽</strong>");
	} 
}

6、IEWebDeveloperV2工具

安裝後按"F12"進入“開發人員工具”-------"查找”-------然後可以進行單擊查看選中元素的屬性

7、ie判斷

document.all可以判斷瀏覽器是否是IE  
  if(document.all){  
    alert("is   IE!");  
  }

例如對ie要直接關閉當前窗口而不提示則需要做如下處理:

			 if(document.all){
				 window.opener=null;
				 window.open("","_self");
			 } 
			 window.close(); 
8 採用el表達式時候,${x.pose} 如果在作爲js方法參數一定要加引號,否則ie會出現感嘆號,導致其他按鈕可能失效。


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