일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Getrows
- DS718+
- Injection
- 무선랜카드
- synology
- 크로스 컴파일
- ASP
- 따라다니는 배너
- RTL88x2BU
- disabled
- XMLHTTP
- PHP GCM
- euc-kr
- 시놀로지
- jquery 레이어
- SQL Injection
- form
- AC1300
- println
- FileSystemObject
- utf-8
- 커널
- lsusb
- include
- submit
- ajax
- jQuery
- replace
- readonly
- javascript
- Today
- Total
아는 것이 좋은 것이다.
[jQuqery] request parameter 받기 본문
<html>
<head>
<meta name="Content-type" type="equiv" content="text/html; charset=utf-8"/>
<title>테스트 파라미터 받기</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<p id="param">aaa</p>
<script>
jQuery(function ($) {
$.fn.getUrlParameter = function (sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
var type = $.fn.getUrlParameter('type');
$("#param").text("type Value : " + type);
});
</script>
</body>
</html>
# 설명
파라미터 type에 값을 넣어주면 스크립트로 값을 받을수 있음( 예 ->http://start0.tistory.com/test.html?type=값1111 )
# 실행 예시
type Value : 값1111
'jQuery' 카테고리의 다른 글
[jQuery] select option value 이외에 다른 값 사용하기(data 함수) (0) | 2019.06.12 |
---|---|
[jQuery] 함수 생성후 호출 (0) | 2015.06.26 |
[jQuery] .trigger() 이벤트 강제 실행 함수 (0) | 2015.02.11 |
[jQuery] ajax 통신후 스크립트 먹통일 경우 (0) | 2015.02.09 |
[jQuery] asp, php 사용하지 않고 include 하기 (0) | 2014.07.13 |