Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7748535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:48:36+00:00 2026-06-01T10:48:36+00:00

I am currently attempting to push html updates to a page for a user

  • 0

I am currently attempting to push html updates to a page for a user using PubNub. I want to push html code to the user (this includes links, quotes, making html necessary), and add it to the end of a table for the user.

I am currently attempting to use the api to send a message as follows:

info = pubnub.publish({
        'channel' : 'myChannel',
        'message' : {
        'some_text' : message
        }
    })

Where message is:

<div class="content">Message text here.<img src="image.gif" border="0" alt="" title="laugh out loud" class="inlineimg" /></div>

My issue is that I am receiving the following message when I attempt to send a page update:

</div> is not JSON serializable

I am assuming this is occurring because I am attempting to send html code?

Any recommendations on how to fix this / better ways to do this? This is my first attempt at “pushing” messages to a webpage, so I may be implementing this all wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:48:38+00:00Added an answer on June 1, 2026 at 10:48 am

    You are attempting to send raw HTML via PubNub and running into the “JSON not Serializable” issue. Firstly, you are correct in assuming that you Can push HTML code! Hurray. Just make sure that the data you place inside the "message" is in fact a STRING. The following types are JSON Serializable:

    1. Objects
    2. Arrays
    3. Strings
    4. Numbers

    Make sure to not send special python classes or functions. These will not serialize. String content can include any UTF-8 character single-byte and multi-byte.

    Use this Python for the "message":

    message = '''<div class="content">Message text here.<img src="image.gif" border="0" alt="" title="laugh out loud" class="inlineimg" /></div>'''
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently attempting to get some code to compile using Lejos for the Lego NXT
I'm currently attempting to code one for part of a college project - binary/hex
I am currently having problems with attempting to style the HTML rich text editor
I am currently attempting to remove a number of .Resolve(s) in our code. I
I'm currently attempting to retrieve a list of objects from my database using jQuery.
I'm currently attempting to track down the source of heap corruption in our code
I am currently attempting to have the browser automatically prompt the user to save
I am attempting to create a page where a user can see what their
I am currently attempting to use a custom module as the first page when
currently i'm attempting to using a switch statement to change between time zone with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.