join the prijm community

prijm is a community of people, just like you helping each other.
join them, it only takes a minute :)

Why wont it post the message

I am watching the video 

https://www.youtube.com/watch?v=eayijy9f240&t=467s

Real Time Python Chat Application using Python Flask SocketIO


And the text wont come up and the console stuff wont work here is my event code please help:

  //broadcast a message

        } )

  e.preventDefault()

  var message = $( 'input.message' ).val()

  socket.emit( 'my event', {

   user: user_name,

   msg: message

  })

  // empty the message field

  })

  // capture message 

  if( typeof msg.user !== 'undefiend'){

  $( 'div.msg-wrapper' ).append( '

'+msg.user+''+msg.msg+'
' )

  console.log( msg )

  } )



1 0
1 reply and 1 comment

the thing wont work here is the real source code


  //broadcast a message

        } )

  e.preventDefault()

  var message = $( 'input.message' ).val()

  socket.emit( 'my event', {

   user: user_name,

   msg: message

  })

  // empty the message field

  })

  // capture message 

  if( typeof msg.user !== 'undefiend'){

  $( 'div.msg-wrapper' ).append( '

'+msg.user+''+msg.msg+'
' )

  console.log( msg )

  } )


 @socketio.on( 'my event' )

 def handle_my_custom_event( json ):

    print ('recived something: ' + str( json ) )

 socketio.emit( 'My response', json )

 
Hi! I am not understanding your problem, do you have any error message? Please try to see if there is any error message on the console, and let me know the error being displayed in the console. Thanks - @rakibtg - reply - 15 Oct 2017
please login or signup to reply
post a reply
discussion resolution do more with this discussion
followed by 1 user added by 0 user save this discussion to reply later make this discussion anonymous
discussion stats
views: 831
replies: 1
favorites: 0
follower: 1
saved: 0
comments: 1