'Development > jQuery' 카테고리의 다른 글
jQuery - URL을 파싱 (0) | 2012.05.29 |
---|---|
jQuery - 플러그인 모음 (0) | 2012.05.29 |
jquery - function 사용법 (0) | 2012.05.23 |
jQuery - form 데이터 유효성 검사 (0) | 2012.05.23 |
Eclipse Aptana Plugin 설치 (0) | 2012.05.21 |
/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
*/
jQuery.extend({
/**
* Returns get parameters.
*
* If the desired param does not exist, null will be returned
*
* @example value = $.getURLParam("paramName");
*/
getURLParam: function(strParamName){
var strReturn = "";
var strHref = window.location.href;
var bFound=false;
var cmpstring = strParamName + "=";
var cmplen = cmpstring.length;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")+1);
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
bFound=true;
break;
}
}
}
if (bFound==false) return null;
return strReturn;
}
});
--------------------------------------------------------------------------------------------------------------
View로 사용할 파일내에 위의 생성한 js 파일을 포함시켜주고
아래와 같은 구문양식으로 사용하면 끝.
$.getURLParam("age") // http://localhost/aa.jsp?name=lee&age=26
해당 함수를 실행하면 "26"이 반환된다.
출처 : Mathias Bank 님의 블로그http://www.mathias-bank.de/2006/10/28/
jquery-plugin-geturlparam/
출처 - http://dptablo.tistory.com/48
jQuery - URL을 파싱 (0) | 2012.05.29 |
---|---|
jQuery - 플러그인 모음 (0) | 2012.05.29 |
jquery - function 사용법 (0) | 2012.05.23 |
jQuery - form 데이터 유효성 검사 (0) | 2012.05.23 |
Eclipse Aptana Plugin 설치 (0) | 2012.05.21 |
by linuxism |
||
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
내 블로그 - 관리자 홈 전환 |
Q
Q
|
---|---|
새 글 쓰기 |
W
W
|
글 수정 (권한 있는 경우) |
E
E
|
---|---|
댓글 영역으로 이동 |
C
C
|
이 페이지의 URL 복사 |
S
S
|
---|---|
맨 위로 이동 |
T
T
|
티스토리 홈 이동 |
H
H
|
단축키 안내 |
Shift + /
⇧ + /
|
* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.