+ JavaScript の質問用スレッド vol.110 +

このエントリーをはてなブックマークに追加
5942/2
$(document).ready(function() {
$("#search2").bind("change", function(){
alert( encodeURI($("#search2").val()));
$.ajax({
beforeSend: function(req) {
req.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
},
contentType :'application/x-www-form-urlencoded',
type : "POST",
url : 'http://jlp.yahooapis.jp/MAService/V1/parse',
data : "appid="+encodeURI('dj0zaiZpPWFDOTJPS2FCeUwwRiZzPWNvbnN1bWVyc2VjcmV0Jng9MGU-')+'&'+
"sentence="+encodeURI($("#search2").val())+'&'+
"filter="+encodeURI('9'),
success: function(msg,xml){
alert( msg);
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert( 'error'+textStatus );
} }) }); });
</script></head>
<body><form action="http://jlp.yahooapis.jp/MAService/V1/parse" method="post">
<input type="text" name="appid" value="dj0zaiZpPWFDOTJPS2FCeUwwRiZzPWNvbnN1bWVyc2VjcmV0Jng9MGU-">
<input type="text" name="sentence" id="search2" value="12345">
<input type="text" name="filter" value="9">
<input type="submit" value="送信する"></form></body></html>