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 908859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:47:04+00:00 2026-05-15T16:47:04+00:00

I have a webservice that returns html string as response. I want to display

  • 0

I have a webservice that returns html string as response. I want to display the response in a div element. The response I am getting from service is

<span style="text-indent: 29px;padding-top:35px;font-size: 16pt;font-family: Arial;color: #FFFFFF;font-weight: bold;position: absolute;text-decoration: none;">89</span>
<span style="text-indent: 41px;padding-top: 58px;font-size: 8pt;letter-spacing: 1px;font-family: Arial;color: #E5DA95;font-weight: bold;position: absolute;text-decoration: none">89</span>
<span style="text-indent: 55px;padding-top: 58px;font-size: 8pt;letter-spacing: 1px;font-family: Arial;color: #E5DA95;font-weight: bold;position: absolute;text-decoration: none">-</span>
<span style="text-indent: 59px;padding-top: 58px;font-size: 8pt;letter-spacing: 1px;font-family: Arial;color: #E5DA95;font-weight: bold;position: absolute;text-decoration: none">92</span>
<img src="https://www.autocheck.com/members/img/freeLinkScore/scoreBanner4.gif" height="75" width="75" border="0">

I used the statement div.innerHTML = response;

The response is getting displayed as text instead of HTML. Can someone please tell me how to display the response as html inside the div.

  • 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-05-15T16:47:05+00:00Added an answer on May 15, 2026 at 4:47 pm

    If that’s your webservice, change its to output an un-HTML-encoded response.

    Otherwise you will have to HTML decode the response before setting it as content.
    I looked for a lightweight decoder and couldn’t find one that was more robust than simple regex.

    So, this will probably work for your immediate needs, just beware that it can break on certain combinations of content (which seem unlikely in this case).

    response = response.replace (/&lt;/ig, '<').replace (/&gt;/ig, '>');
    

    .
    PS: Be sure that this webserver can’t supply you with malicious html, like <script> tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WebService that returns XML in a SOAP response: <?xml version=1.0 encoding=utf-8
I have a web service that returns this string via the jQuery $.ajax() call
I want to retrieve data from restful webservice that returns xml. I'm using phonegap.
I have a web service that returns HTML for a table (for optimization purposes)
I have an ASP.NET webservice that returns JSON. Now, using jQuery I want to
I have a webservice that returns a list of Clinics near a certain lat/long.
I have an application in which I have a webservice call that returns data
I have an ASP.NET WebService that returns an object of List public class Students
I have a RPC encoded PHP webservice that returns a simple soap envelope with
I have a webservice method that reads a photo and returns its byte data.

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.