-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
29 lines (26 loc) · 891 Bytes
/
main.js
File metadata and controls
29 lines (26 loc) · 891 Bytes
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
function _c (id) {
$.getJSON("https://mc3.nakn.jp/api/ytquestion", { get: id}).done(function(data) {
$('#title').text(data.title);
}).fail(function(err) {
$('#title').text("接続出来ません");
});
}
$('#send').on('click', function() {
$('#emsg').text("");
$('#sendg').hide();
$.getJSON("https://mc3.nakn.jp/api/ytquestion", { send: _getargs().get, content: $('#content').val() }).done(function(data) {
$('#msg').text("送信しました。");
}).fail(function(err) {
$('#emsg').text("うまく送れませんでした。。");
$('#sendg').show();
});
});
function _getargs () {
var arg = new Object;
url = location.search.substring(1).split('&');
for(i=0; url[i]; i++) { var k = url[i].split('='); arg[k[0]] = k[1];}
return arg;
}
$(function () {
_c(decodeURIComponent(_getargs().get));
});