mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
21 lines
432 B
JavaScript
21 lines
432 B
JavaScript
var ip;
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "//jsonip.appspot.com/?callback=?",
|
|
dataType: "jsonp",
|
|
success: function(getip) { ip = getip.ip; }
|
|
});
|
|
function sendChat(me, message) {
|
|
var data = '{"name":"'+ip+'","message":"'+message+'"}';
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'up/sendmessage',
|
|
data: data,
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
//handle response
|
|
if(response)
|
|
me.onPlayerChat('', response);
|
|
}
|
|
});
|
|
} |