12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- $(document).ready(function()
- {
- Chat.init();
- });
- var Chat =
- {
- addIndex : 2,
- init : function()
- {
- var self = this;
- $(".ds-post-button").html('发布');
- $(".ds-post-button").bind('click', function()
- {
- self.send($(this));
- });
- },
-
- load : function()
- {
-
- },
-
- send : function(e)
- {
- var self = this;
- e.html('发布中...');
- e.unbind('click');
-
- var id = $("#id").val();
- var content = $("#content").val();
- if(!id)
- {
- alert('错误的信息');
- self.init();
- return;
- }
- if(!content)
- {
- alert('请填写内容');
- self.init();
- return;
- }
- $.post(config.host + 'weixin/chat.send', {id:id,content:content}, function(t)
- {
- alert('发布成功');
- location.reload();
- self.init();
- });
- }
- }
|