<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.7.0/build/button/assets/skins/sam/button.css">
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.7.0/build/yahoo-dom-event/yahoo-dom-event.js&2.7.0/build/element/element-min.js&2.7.0/build/button/button-min.js&2.7.0/build/connection/connection-min.js"></script>
<script type="text/javascript">
function onButtonReady() {
var oButton = new YAHOO.widget.Button("yuibut");
oButton.on("click", callRemote);
}
YAHOO.util.Event.onContentReady("yuibut", onButtonReady);
var transaction;
var sUrl;
var callback = {
success: function(o) {
alert(o.responseText);
},
failure: function(o) {
alert("錯誤:無法取得回應");
}
};
function callRemote() {
sUrl = "/jlu/servlet/HelloWorld?name=" +
encodeURIComponent(document.getElementById('name').value);
transaction = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback, null);
}
</script>
</head>