레이블이 BufferedWriter인 게시물을 표시합니다. 모든 게시물 표시
레이블이 BufferedWriter인 게시물을 표시합니다. 모든 게시물 표시

2013년 10월 23일 수요일

(제이쿼리jquery 강좌)jQuery를 통한 키보드 이벤트, keydown, keyup, keypress jQuery를 통한 키보드 이벤트

(제이쿼리jquery 강좌)jQuery를 통한 키보드 이벤트, keydown, keyup, keypress


jQuery를 통한 키보드 이벤트

keydown : 키 눌러질때,   keypress:글자가입력될때
keyup : 키보드가 떨어질 때

<script type="text/javascript">
$(document).ready(function() {
//keydown 이벤트가발생한순간에는글자가입력되어있지않음
//입력한글자수를표시해야하므로keyup 이벤트사용
$("textarea").keyup(function () {
//남은 글자수 구합니다.
var inputLength = $(this).val().length;
var remain = 50 ? inputLength;
//남은 글자수 display
$("h1").html(remain);
//문서객체 색상 변경
if (remain >= 0) {
$("h1").css("color","Blue");
} else {
$("h1").css("color","red")
}
});
});
</script>
<body><div>
<p>지금 내 생각을</p>
<h1>50</h1>
<textarea cols="40" rows="5"></textarea>
</div>
</body>



[기타 다른 강좌는 아래 해당 카테고리를 클릭해주세요]

 

(제이쿼리jquery 강좌)jQuery를 통한 키보드 이벤트, keydown, keyup, keypress jQuery를 통한 키보드 이벤트

(제이쿼리jquery 강좌)jQuery를 통한 키보드 이벤트, keydown, keyup, keypress


jQuery를 통한 키보드 이벤트

keydown : 키 눌러질때,   keypress:글자가입력될때
keyup : 키보드가 떨어질 때

<script type="text/javascript">
$(document).ready(function() {
//keydown 이벤트가발생한순간에는글자가입력되어있지않음
//입력한글자수를표시해야하므로keyup 이벤트사용
$("textarea").keyup(function () {
//남은 글자수 구합니다.
var inputLength = $(this).val().length;
var remain = 50 ? inputLength;
//남은 글자수 display
$("h1").html(remain);
//문서객체 색상 변경
if (remain >= 0) {
$("h1").css("color","Blue");
} else {
$("h1").css("color","red")
}
});
});
</script>
<body><div>
<p>지금 내 생각을</p>
<h1>50</h1>
<textarea cols="40" rows="5"></textarea>
</div>
</body>



[기타 다른 강좌는 아래 해당 카테고리를 클릭해주세요]

 

2013년 9월 8일 일요일

닷넷, C#, ASP.NET, 간단한 ASP.NET 프로그램, 닷넷웹프로그램, ASP.NET강좌교육
 
웹페이지에 ASP.NET 코드 넣기:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
 
아래의 간단한 예를 보자
 
<script language="C#" runat="server">
       void Page_Load() {
             Response.Write("Hello C#코드 안에서<BR>");        
       }
</script>
<html>
       <head></head>
       <body>
             Hello... HTML 안에서
       </body>
</html>
 
위의 예제를 실행 하기 위해서는 c:\inetpib\wwwroot 아래에 hello.aspx로 저장 하고 http://lcoalhost/hello.aspx로 웹브라우저에서 실행 하면 된다.
 
아래의 예제도 같은 결과를 나타낸다. Page_Laod() 함수는 가장 먼저 시작되므로
 
<html>
       <head></head>
       <body>
             Hello... HTML 안에서 <BR>
             <script language="C#" runat="server">
                    void Page_Load() {
                           Response.Write("Hello C#코드 안에서<BR>");
                    }
             </script>
       </body>
</html>
 
 
아래의 경우는 인라인 코드 블록을 사용한 예 이다.
 
<html>
       <head></head>
       <body>
             Hello... HTML 안에서 <BR>
             <% Response.Write ("Hello2...") %>
       </body>
</html>
 
아래의 경우는 ASP.NET 서버 컨트롤을 이용하여 작성 한 간단한 예 이다.
 
<script language="C#" runat="server">
       void Page_Load() {
             Message.Text = "ASP.NET...";
       }
</script>
<html>
<head></head>
<body>
       첫번째 HTML 라인 <br/>
       <asp:label id=Message runat="server"/><br/>
       두번째 HTML 라인 <br/>
</body>
</html>
 
 
물론 이상의 경우외에 ASP.NET 코드를 HTML과 별도의 파일로 분리하는 방법도 존재 한다. (src 이용)
 
 
 
 
 
 
[예제 : 간단한 XML 문서의 제작]
 
먼저 c:\inetpub\wwwroot에 학생.xml을 만들자
 
<?xml version="1.0" encoding="euc-kr"?>
<학생>
       <이름>홍길동</이름>
       <나이>22</나이>
       <주소>서울 강남구 역삼동</주소>
</학생>
 
 
xmlTest.aspx
 
<%@ Page language="C#" runat="server" Debug="true"%>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Xml" %>
 
<script language="C#" runat="server">
       void Page_Load() {
             string xmlFile = @"c:\inetpub\wwwroot\학생.xml";
             DataSet ds = new DataSet();
             ds.ReadXml(xmlFile);
 
             DataGrid1.DataSource = ds;
             DataGrid1.DataBind();
       }
</script>
<html>
<head></head>
<body>
       <asp:DataGrid id="DataGrid1" runat="server"/>
</body>
</html>



오라클자바커뮤니티 실전 개발자 강좌 - 개인80% 환급

C#4.0, ADO.NET, Network 프로그래밍 4일 32시간   09-24
C#,ASP.NET마스터 8일 56시간   09-25
ASP.NET4.0 MVC 프로그래밍 4일 32시간   09-30
C#,ASP.NET마스터 18일 54시간   09-25
ASP.NET4.0 MVC 프로그래밍 11일 33시간   09-26
C#4.0, ADO.NET, Network 프로그래밍 11일 33시간   09-30
C#,ASP.NET마스터 8일 56시간   09-14
C#4.0, ADO.NET, Network 프로그래밍 4일 32시간   09-28
ASP.NET4.0 MVC 프로그래밍 4일 32시간   09-28