在做參數轉換時才知 java.net.URLEncoder.encode is deprecated
查了一下只要稍為轉換一下就可以了
主要是要進行編碼時,要指定編碼格式 EX:
URLEncoder.encode("{123, abc}","UTF-8");
這樣即可進行轉碼了
URLEncoder.encode("{123, abc}","UTF-8");
List<String> list = new ArrayList<String>();
list.add("A");
list.add("B");
list.add("C");
list.add("D");
list.add("E");
System.out.println(list);
當直接 output 時會顯示 [A, B, C, D, E]
list.add("A");
list.add("B");
list.add("C");
list.add("D");
list.add("E");
list.add(2, "F");
System.out.println(list);
list.add("A");
list.add("B");
list.add("C");
list.add("D");
list.add("E");
list.reomve(1);
list.add(2, "F");
System.out.println(list);
這時output 會顯示 [A, C, F, D, E ] ,由此可證 被刪除和插入,List index 都會即時做變化
ErrorDocument 404 /errors/not_found.html
2.如果有開mod_rewirte 可以設定在.htaccess
ErrorDocument 404 /pages/errors/404.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/404/$
RewriteRule ^(.*)$ /pages/errors/404.php [L]
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
// fix for deprecated method in Chrome 37
window.showModalDialog = function (arg1, arg2, arg3) {
var w;
var h;
var resizable = "no";
var scroll = "no";
var status = "no";
// get the modal specs
var mdattrs = arg3.split(";");
for (i = 0; i < mdattrs.length; i++) {
var mdattr = mdattrs[i].split(":");
var n = mdattr[0];
var v = mdattr[1];
if (n) { n = n.trim().toLowerCase(); }
if (v) { v = v.trim().toLowerCase(); }
if (n == "dialogheight") {
h = v.replace("px", "");
} else if (n == "dialogwidth") {
w = v.replace("px", "");
} else if (n == "resizable") {
resizable = v;
} else if (n == "scroll") {
scroll = v;
} else if (n == "status") {
status = v;
}
}
var left = window.screenX + (window.outerWidth / 2) - (w / 2);
var top = window.screenY + (window.outerHeight / 2) - (h / 2);
var targetWin = window.open(arg1, arg1, 'toolbar=no, location=no, directories=no, status=' + status + ', menubar=no, scrollbars=' + scroll + ', resizable=' + resizable + ', copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
targetWin.focus();
};
這段主要是將window.showModalDialog進行宣告,如在IE會是覆寫改用此作法,這樣原本的showModalDialog都不用改code,即可運行,這樣至少不用一行一行CODE去改寫
呼叫頁(父頁)
var returnValue = window.showModalDialog(…);
處理頁(子頁)
window.returnValue = data;
window.close();
function setReturnValue(data){
if (data != null) {
document.forms[0].elements["id"].value = data[0];
….
}
}
window.opener.setReturnValue(data) ;
<meta http-equiv="x-ua-compatible" content="ie=8" />
標籤
CKEDITOR.editorConfig = function( config ) {
config.enterMode = CKEDITOR.ENTER_BR // pressing the ENTER Key puts the <br/> tag
config.shiftEnterMode = CKEDITOR.ENTER_P; //pressing the SHIFT + ENTER Keys puts the <p> tag
};