<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<? include "../Anyjquery/jquery_inc.php"; ?>
<script language="javascript">
$(function(){
//$.extend
//({ 펑션명:function(인자){return 펑션인자값} });
//중간에 펑션이 여러개 들어가는 경우 function(){}, 처럼 , 표시 해주면 됨.
$.extend({
min_val:function(a,b){
return a<b? a: b;
},
max_val:function(a,b){
return a>b? a: b;
},
go_move:function(msg,go){
alert(msg);
location.href=go;
}
});
//펑션 사용법 : $.펑션명(인자값)
$('#cal').click(function(){
//경고창으로 내용알리기
/*
alert("min value["+$.min_val($('#pre').val(),$('#after').val())+"]"
+
"max value["+$.max_val($('#pre').val(),$('#after').val())+"]");
*/
//result id 가진 element에 값넣기
$('#result').append("min value["+$.min_val($('#pre').val(),$('#after').val())+"]"
+
"max value["+$.max_val($('#pre').val(),$('#after').val())+"]");
});
$('#go_page').click(function(){
$.go_move($("#message").val(),"http://naver.com");
});
});
</script>
</HEAD>
<BODY>
<div>
<input type="text" id="pre">
<input type="text" id="after">
<input type="button" id="cal" value="cal!">
</div>
<div>
<input type="text" id="message">
<input type="button" id="go_page" value="go_page">
</div>
<span id="result"></span>
</BODY>
</HTML>