pull/2/head
宿召阳 2014-11-07 15:33:41 +08:00
parent 0e3c79fb79
commit 0560ccaf17
2 changed files with 8 additions and 6 deletions

View File

@ -34,6 +34,12 @@ $.fn.webSocket = function(opt){
message.id = genUid(); message.id = genUid();
message.filename = node.attr('filename'); message.filename = node.attr('filename');
BootstrapDialog.show({message:function(){ BootstrapDialog.show({message:function(){
var escape = function (html){
var elem = document.createElement('div')
var txt = document.createTextNode(html)
elem.appendChild(txt)
return elem.innerHTML;
}
var tag = $('<div id="log" style="height:300px;"></div>'); var tag = $('<div id="log" style="height:300px;"></div>');
//告诉服务器端有用户登录 //告诉服务器端有用户登录
socket.emit('login', {userid:message.id, filename:message.filename}); socket.emit('login', {userid:message.id, filename:message.filename});
@ -47,12 +53,7 @@ $.fn.webSocket = function(opt){
}}); }});
} }
var escape = function (html){
var elem = document.createElement('div')
var txt = document.createTextNode(html)
elem.appendChild(txt)
return elem.innerHTML;
}
$this.on("click",function(e){ $this.on("click",function(e){
init(e); init(e);
return false; return false;

View File

@ -46,6 +46,7 @@
}}); }});
return false; return false;
}) })
$(".monitor").webSocket()
</script> </script>
<!--<button class="btn btn-primary">删除</button>--> <!--<button class="btn btn-primary">删除</button>-->
</form> </form>