Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body bgcolor="black">
- <table id="t"bgcolor="#00BBBB"style="border:4px solid #006666"></table>
- <script>
- if('WebSocket' in window){alert("WebSocket supported")}else{alert("Your shitty browser doesn't support WebSocket, sorry.")}
- name=prompt("Enter your name, please.")
- net=new XMLHttpRequest
- if(name==""){name="¿?"}
- onkeydown=function(){net.send(
- 'row=t.insertRow(0)'+
- 'c1=row.insertCell(0)'+
- 'c2=row.insertCell(1)'+
- 'c1.innerHTML='+name+
- 'c1.style.backgroundColor="#00FF00"'+
- 'c2.innerHTML='+prompt("Enter your message.")+
- 'c2.style.backgroundColor="#0000FF"'
- )}
- net.onopen=function(){
- net.send(
- 'row=t.insertRow(0)'+
- 'c1=row.insertCell(0)'+
- 'c2=row.insertCell(1)'+
- 'c1.innerHTML='+name+
- 'c1.style.backgroundColor="#00FF00"'+
- 'c2.innerHTML="Has connected sucessfully."'+
- 'c2.style.backgroundColor="#00FFFF"'
- )}
- net.onerror=function(error){
- 'row=t.insertRow(0)'+
- 'c1=row.insertCell(0)'+
- 'c1.innerHTML='+error+
- 'c1.colSpan="2"'+
- 'c1.style.backgroundColor="#FF0000"'
- }
- net.onmessage=function(e){e.data}
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement