일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- MySQL
- rowspan
- appspresso
- 전자정부프레임워크
- Spring
- PHP
- phonegap
- oracle
- Ajax
- ibsheet
- JSON
- 선택적조인
- swingx
- Eclipse
- jQuery
- 가우스
- sencha touch
- iBATIS
- jsr 296
- GPS
- Android
- JDOM
- MFC
- Google Map
- PLSQL
- tomcat
- Struts
- WebLogic
- node.js
- dock
Archives
- Today
- Total
Where The Streets Have No Name
[dojo] HelloWorld 본문
<html>
<head>
<title>Dojo: Hello World!</title>
<!-- SECTION 1 -->
<style type="text/css">
@import "./dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
@import "./dojo-release-1.0.0/dojo/resources/dojo.css"
</style>
<script type="text/javascript" src="./dojo-release-1.0.0/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
// Load Dojo's code relating to the Button widget
dojo.require("dijit.form.Button");
function helloCallback(data,ioArgs) {
alert(data);
}
function helloError(data, ioArgs) {
alert('Error when retrieving data from the server!');
}
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" id="helloButton">
Hello World!
<script type="dojo/method" event="onClick">
alert('You pressed the button');
</script>
</button>
<button dojoType="dijit.form.Button" id="serverCallButton">
서버호출
<script type="dojo/method" event="onClick">
dojo.xhrGet({
url: 'response.txt',
load: helloCallback,
error: helloError
});
</script>
</button>
<button dojoType="dijit.form.Button" id="getButton">
서버호출Get
<script type="dojo/method" event="onClick">
dojo.xhrGet({
url: 'HelloWorldResponseGET.jsp',
load: helloCallback,
error: helloError,
content: {name: dojo.byId('name').value }
});
</script>
</button>
Please enter your name: <input type="text" id="name">
<br>
<form id="myForm" method="POST">
Please enter your name: <input type="text" name="name2">
</form>
<button dojoType="dijit.form.Button" id="postButton">
서버
<script type="dojo/method" event="onClick">
dojo.xhrPost({
url: 'HelloWorldResponsePOST.jsp',
load: helloCallback,
error: helloError,
form: 'myForm'
});
</script>
</button>
</body>
</html>
# jsp source
<head>
<title>Dojo: Hello World!</title>
<!-- SECTION 1 -->
<style type="text/css">
@import "./dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
@import "./dojo-release-1.0.0/dojo/resources/dojo.css"
</style>
<script type="text/javascript" src="./dojo-release-1.0.0/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
// Load Dojo's code relating to the Button widget
dojo.require("dijit.form.Button");
function helloCallback(data,ioArgs) {
alert(data);
}
function helloError(data, ioArgs) {
alert('Error when retrieving data from the server!');
}
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" id="helloButton">
Hello World!
<script type="dojo/method" event="onClick">
alert('You pressed the button');
</script>
</button>
<button dojoType="dijit.form.Button" id="serverCallButton">
서버호출
<script type="dojo/method" event="onClick">
dojo.xhrGet({
url: 'response.txt',
load: helloCallback,
error: helloError
});
</script>
</button>
<button dojoType="dijit.form.Button" id="getButton">
서버호출Get
<script type="dojo/method" event="onClick">
dojo.xhrGet({
url: 'HelloWorldResponseGET.jsp',
load: helloCallback,
error: helloError,
content: {name: dojo.byId('name').value }
});
</script>
</button>
Please enter your name: <input type="text" id="name">
<br>
<form id="myForm" method="POST">
Please enter your name: <input type="text" name="name2">
</form>
<button dojoType="dijit.form.Button" id="postButton">
서버
<script type="dojo/method" event="onClick">
dojo.xhrPost({
url: 'HelloWorldResponsePOST.jsp',
load: helloCallback,
error: helloError,
form: 'myForm'
});
</script>
</button>
</body>
</html>
# jsp source
<%
/*
' HelloWorldResponseGET.jsp
' --------
'
' Print the name that is passed in the
' 'name' GET parameter in a sentence
*/
response.setContentType("text/plain");
%>
Hello <%= request.getParameter("name") %> , welcome to the world of Dojo!
/*
' HelloWorldResponseGET.jsp
' --------
'
' Print the name that is passed in the
' 'name' GET parameter in a sentence
*/
response.setContentType("text/plain");
%>
Hello <%= request.getParameter("name") %> , welcome to the world of Dojo!