'JQuery'에 해당되는 글 2건

JQuery



예1)

opener.parent.location=’부모창주소(원하는주소)';

 

- 원하는 주소를 직접 써줘도되고

 

예2)

opener.parent.location.reload();
window.close();

 

- 이런식으로 reload를 써줘도 된다.

 

 

window.close() 는

<(input type=”button” value=”목록” style=”width:50px;” (onclick=”window.close();” />

이런식으로 써주면 목록버튼을 누를때 팝업창이 닫히게 된다.

0 0

JQuery



<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>load demo</title>
<style>
body {
font-size: 12px;
font-family: Arial;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<b>Successful Response (should be blank):</b>
<div id="success"></div>
<b>Error Response:</b>
<div id="error"></div>
<script>
$( "#success" ).load( "/not-here.php", function( response, status, xhr ) {
if ( status == "error" ) {
var msg = "Sorry but there was an error: ";
$( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
}
});
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>load demo</title>
<style>
body {
font-size: 12px;
font-family: Arial;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>

<div id="success"></div>

<script>
$( "#success" ).load( "aaa.php", function( response, status, xhr ) {});
</script>
</body>
</html>


GET 방식

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
$(document).ready(function(){
 $(‘#btn’).click(function(){
                $.get('a.jsp', {'param1' : '파라미터내용1', 'param2' : '파라미터내용2'}, function(data){
                    $(‘#ajaxDiv’).load(‘sub/aaa.html’);
                });
  return false;
 }); 
});

POST 방식

 <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
$(document).ready(function(){
 $(‘#btn’).click(function(){
                $.post('a.jsp', {'param1' : '파라미터내용1', 'param2' : '파라미터내용2'}, function(data){
                    $('#ajaxDiv').load('sub/aaa.html');
                });
  return false;
 }); 
});

a.jsp?param1=파라미터내용1¶m2=파라미터내용2 형식으로 호출됨

0 0

1
블로그 이미지

www.100479.net

붉은양말