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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:04:37+00:00 2026-06-01T00:04:37+00:00

I am rendering this line of code in a <pre> tag to display as

  • 0

I am rendering this line of code in a <pre> tag to display as normal text on screen:

<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=7&size=700x540&sensor=false$center=London, England&markers=London, England|Leicester, England|">

however it is being misrendered in multiple browsers as:

<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=7&size=700x540&sensor=false¢er=London, England&markers=London, England|Leicester, England|">

Since the escape code for a cent symbol is &cent; and not &cent, I cannot see why this is happening and there doesn’t seem to be any way to prevent it. Can anyone help?

Also, my doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

If it makes any difference, this line of code is being added to the document by Javascript’s innerHTML method.

  • 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-01T00:04:39+00:00Added an answer on June 1, 2026 at 12:04 am

    Just because something is in a <pre> doesn’t mean you don’t have to escape it (doctype makes no difference here). Any instance of & should use the entity &amp; if you want & to be displayed on screen. You can get away without it sometimes, but that’s just the browser being forgiving – you shouldn’t take advantage of it. The browser may try to convert to an entity if it recognizes one, even if the semicolon is missing (being forgiving again).

    The whole thing (source) should be:

    <pre>&lt;img src=&quot;http://maps.googleapis.com/maps/api/staticmap?zoom=7&amp;size=700x540&amp;sensor=false&amp;center=London, England&amp;markers=London, England|Leicester, England|&quot;&gt;</pre>

    By the way, this is true for attribute values too, like href. It’s common for people to be “lazy” and not escape the ampersands in query strings, but you really should.

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

Sidebar

Related Questions

Shouldn't this line of code render a inputtext field with the placeholder text fill
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
I'm rendering some HTML in a QT QLabel. The HTML looks like this: <pre>foo\tbar</pre>
I had the following HTML page rendering to use the Google Maps API. This
I am using this plugin to create charts: http://www.filamentgroup.com/lab/update_to_jquery_visualize_accessible_charts_with_html5_from_designing_with/ The code works below if
When presenting preformatted text on the web (e.g. code samples), line wrapping can be
This post concerns only IE. The last line of the following code is causing
My question is about rails rendering rule. if the the following line of code
SELECT **FIELDS** AS [text()] --Stops the XMLPATH line rendering output as XML FROM #temp
I have an image that I'm rendering like this: glDrawPixels(image->width, image->height, GL_BGR, GL_UNSIGNED_BYTE, image->imageData);

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.