ํฐ์คํ ๋ฆฌ ๋ทฐ
var Common = {
/**
* ํ๋๊ฐ ๋น์ด ์๋ ์ง ๊ฒ์ฌ
*/
isValue: function(str){
if (( str == null) || (str == "") || Common.isblank(str))
return false;
return true;
},
/**
* ๋ฌธ์์ด์ ๊ณต๋ฐฑ ๋ฌธ์๋ง ํฌํจ๋ ๊ฒฝ์ฐ์๋ true๋ฅผ ๋ฐํํ๋ ์ ํธ๋ฆฌํฐ ํจ์
*/
isblank: function(str) {
for(var i = 0; i < str.length ; i++ ){
var c = str.charAt(i);
if ( (c != ' ') && (c != '\n') && (c != '\et')) {
return false;
}
}
return true;
},
/**
* ์ ๊ท์(Regular Expression)์ ์ฌ์ฉํ ์๋ค ํธ๋ฆผ์๋ค.
*/
trim: function(str) {
regExp = /([^\s*$]?)(\s*$)/;
newStr = str.replace(regExp, "$1");
regExp = /(^\s*)(.+)/;
newStr = newStr.replace(regExp, "$2");
return newStr;
},
/**
* ํ์ผ ํ์ฅ์ ์ฒดํฌ.
* @param {checkExt} ํ์ฉํ๋ ํ์ฅ์ (eg. jpg|gif|bmp|...)
*/
checkExt: function(str, checkExt) {
if(str == "") return true;
var dotIndex = str.lastIndexOf(".");
var ext = str.substring(dotIndex+1).toLowerCase();
var pattern = eval("/^(" + checkExt.toLowerCase() + "){1}$/");
return (ext.search(pattern) != -1);
},
/**
* ๋ก๊ทธ์ธ ์ฒดํฌ
* @param {redirct url}
*/
login : function(url) {
var from_url = (url != "")? url : location.href;
location.href = "login.asp?from_url="+escape(from_url);
},
/**
* ๋ก๊ทธ์ธ ์ฒดํฌ(๋ฉ์ธ์ง ํฌํจ, ์ธ์ ํค์กด์ฌ์:true)
* @param {redirct url, sessionKey}
*/
checkLogin : function(url, sessionKey) {
var bRtn = false;
var from_url = (url != "")? url : location.href;
if(sessionKey == "") {
if(confirm("๋ก๊ทธ์ธ ํ ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.\n\n๋ก๊ทธ์ธ ํ์๊ฒ ์ต๋๊น?"))
location.href = "login.asp?from_url="+escape(from_url);
}
else
bRtn = true;
return bRtn;
}
};
'JS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ธ๋ผ์ฐ์ ์ฌ์ด์ฆ๊ตฌํ๊ธฐ, ์คํฌ๋ฆฐ ์ฌ์ด์ฆ๊ตฌํ๊ธฐ (0) | 2013.07.19 |
---|---|
๋์ jQuery ๋ ์ด์์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ (0) | 2013.05.31 |
jquery opener.window ํ์ ์์ ๋ถ๋ชจ์ฐฝ์ ์ ๊ทผ (0) | 2013.05.13 |
angular.js ์ ๋ ๋ญ์ผ? (0) | 2013.03.28 |
์๋ฐ์คํฌ๋ฆฝํธ ์ฃผ์ํํ (0) | 2013.03.07 |
- Total
- Today
- Yesterday
- ๊ฒฝ์ ์ฉ์ด
- ์นด๋ฐ์จ๋ผ์ธ
- ๋ฉ๋ฐฐํ
- asp
- ํจ์
- ์๋ฐ์คํฌ๋ฆฝํธ
- ๊ธฐํ
- ์๋ธ๋ฆฟ
- JavaScript
- EL
- ์๋ฆฌ
- php
- MySQL
- I Don't Care
- ์ธํจ์ด
- 2ne1
- Java
- ๋์ค
- JSON
- JSTL
- ๋ณต๊ทผ์ด๋
- ์์์ฌ์ด๋
- JSP
- MS-SQL
- jQuery
- 8๋ง์ผ
- Servlet
- ์น์์ด์ ์
- Ajax
- JS
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |