Last active
August 29, 2015 14:04
-
-
Save Sankame/a9da32445d224fb1df63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Ajax POSTテスト */ | |
function ajaxTest(){ | |
$.ajax({ | |
type : "POST", | |
url : "/test/", | |
data : {"test":"hoge"}, | |
scriptCharset : "UTF-8", | |
success : function(msg, status){ | |
var json = eval(msg); | |
var result = Boolean(json['result']); | |
var message = json['message']; | |
if(result){ | |
alert(result); | |
}else{ | |
alert(message); | |
} | |
}, | |
error : function(msg, status){ | |
alert('通信ができない状態です。'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment