반응형

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>자바 스크립트 연습</title>

</head>

<body>

<!-- js 폴더의 jun.js 파일을 불러다 사용 -->

<script src="js/jun.js"></script>


<script>

/*

//변수 명

var v = "안녕하세요";

//바디 영역에 출력

document.write(v);

//대화 상자로 출력

alert(v);

*/


// 10,20,30을 갖는 배열을 생성

var ar = new Array(10, 20, 30);

alert(ar.toString());


var variable;

//선언하지 않은 변수를 출력 -undefined

alert(variable);


alert(typeof (ar));


for (var i = 0; i < 3; i++) {

alert(ar[i]);


}

for(var temp in ar){

alert(temp);

}

</script>


</body>

</html>

'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기4  (0) 2014.11.18
[JSP] javaseript 사용하기3  (0) 2014.11.18
[JSP] javaseript 사용하기1  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
반응형

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>스크립트 함수</title>

</head>

<body>

<script>

//대화상자를 출력하는 함수를 선언

function display() {

alert("매개변수가 없는 함수");

}


function add(first, second) {

return first + second;

}


//display 함수 호출

display();


alert(add(100, 300));

//정수 2개를 받아서 정수 2개 사이의 합을 리턴하는 변수

function sum(first, second) {

var start, end;

//입력된 2개이 숫자 중에서 작은 수를 start에 대입

//큰수를 end에 대입

if (first <= second) {

start = first;

end = second;

}

else {

start = second;

end = first;

}

//start에서 end까지의숫자의 합을 구해서 리턴

var sum1=0;

for(int i=start;i<end;i++){

sum1 = sum1+i;

}

return sum1;

}

alert(sum(30,10));

//정수 2개를 받아서 정수 2개 사이의 합을 리턴하는 변수

function sum() {

if (arguments[0] <= arguments[1]) {

start = arguments[0];

end = arguments[1]

}

else {

start = arguments[1];

end = arguments[0];

}

//start에서 end까지의숫자의 합을 구해서 리턴

var sum=0;

for(int i=start;i<end;i++){

sum = sum+i;

}

return sum;

}

</script>


</body>

</html>

'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기3  (0) 2014.11.18
[JSP] javaseript 사용하기2  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
[JSP] Mysql 과 jsp 파일로 접속하기  (0) 2014.11.18
반응형


20140829_css.zip

html css 공부한 내용들입니다.

css 적용법과 사용법이 있습니다.

'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기2  (0) 2014.11.18
[JSP] javaseript 사용하기1  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
[JSP] Mysql 과 jsp 파일로 접속하기  (0) 2014.11.18
[Mobile Web] Accordion  (0) 2014.11.18
반응형

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>json 파싱 결과</title>

<script type="text/javascript">

window.onload = function (){

loadJSONDoc('json.action');

};

function loadJSONDoc(url){

   if (window.XMLHttpRequest) {

       xmlhttp=new XMLHttpRequest();

   } else {

       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

   }

   xmlhttp.open("GET",url,true);

   xmlhttp.send();

   xmlhttp.onreadystatechange=function(){

        if (xmlhttp.readyState==4 && xmlhttp.status==200) {

            xmlDoc=xmlhttp.responseText;

            var ar = JSON.parse(xmlDoc);

            var output="<ul id=goods>"

            for(var i=0; i<ar.length; i++){

            output +="<li>상품명:" + ar[i].title + " 원산지:"+ ar[i].manufacture+ " 가격:" + ar[i].price +"</li>";

            }

            output+="</ul>"

          document.body.innerHTML += output;

        }

   };

}

</script>


 


</head>

<body>

dddd

</body>

</html>










'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기1  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Mysql 과 jsp 파일로 접속하기  (0) 2014.11.18
[Mobile Web] Accordion  (0) 2014.11.18
[Mobile Web] Jquery Mobile1  (0) 2014.11.18
반응형

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>데이터 베이스 접속 확인</title>

</head>

<body>

<!-- 데이터베이스 사용을 위한 패키지 import -->

<%@ page import="java.sql.*" %>


<%

try{

Class.forName("com.mysql.jdbc.Driver");


//데이터베이스 접속

Connection con =

DriverManager.getConnection(

"jdbc:mysql://127.0.0.1:3306/db",

"id","password");

if(con !=null){

out.println("접속 성공");

con.close();

}else{

out.println("접속 실패");

}

}catch(Exception e){

out.println(e.getMessage());

}


%>



</body>

</html>

'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기1  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
[Mobile Web] Accordion  (0) 2014.11.18
[Mobile Web] Jquery Mobile1  (0) 2014.11.18
반응형

<%@ page language="java" contentType="text/html; charset=UTF-8"

pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>모바일!!! 메인페이지</title>

<script type="text/javascript">

function move_1() {

location.href = 'allList.action';

}

</script>

</head>

<body>


<input type="button" value="데이터 가져오기" onclick="move_1()" />


</body>

</html>

20141014Accordion.zip


'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기1  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
[JSP] Mysql 과 jsp 파일로 접속하기  (0) 2014.11.18
[Mobile Web] Jquery Mobile1  (0) 2014.11.18
반응형

<%@ page language="java" contentType="text/html; charset=EUC-KR"

pageEncoding="EUC-KR"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">

<title>제이쿼리 모바일</title>

<link rel="stylesheet"

href="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css" />

<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>

<script

src="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>



</head>

<body>

<div data-role="page">


<div data-role="header">

<a href="#" data-icon="gear" class="ui-btn-left">Settings</a>

<h1>Mobile</h1>

<a href="#" data-icon="gear" class="ui-btn-right">Settings</a>

<div data-role="navbar">

<ul>

<li><a href="#" data-icon="home" data-theme="b">One</a></li>

<li><a href="#" data-icon="gear" data-theme="c">Two</a></li>

<li><a href="#" data-icon="grid" data-theme="d">Two</a></li>

<li><a href="#" data-icon="star" data-theme="e">Two</a></li>

</ul>

</div>

</div>




<div data-role="content">

<ul data-role="listview">

</li>

<li>북한</li>

<li>중국</li>

<li>일본</li>

</ul>

</div>

<div data-role="footer">

<h1>바닥글</h1>

</div>


</div>


</body>

</html>



20141013Mobileweb.zip


'Web개발 > JSP, Web' 카테고리의 다른 글

[JSP] javaseript 사용하기1  (0) 2014.11.18
[html / CSS] 사용하기  (0) 2014.11.18
[JSP] Json 파싱하기  (0) 2014.11.18
[JSP] Mysql 과 jsp 파일로 접속하기  (0) 2014.11.18
[Mobile Web] Accordion  (0) 2014.11.18

+ Recent posts