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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:31:56+00:00 2026-06-13T06:31:56+00:00

I am new to javascript and coding htmls. I am working on a side

  • 0

I am new to javascript and coding htmls. I am working on a side project and I’m stuck. I have a html file that contains an image(let’s call it file1) and I would like to render file1 in another html file called file2. By render I mean display the image contained in file1 in file2. I researched and found stuff like using dataURIs and read a lot about it but it didn’t work. I found an encoder online that encoded my file1 to a base 64 and inserted it in my page like this:

<img src="data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHRpdGxlPk1hdGhKYXggTGF0ZXggRGlzcGxheSBUZXN0IFBhZ2U8L3RpdGxlPgoKPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiIHNyYz0iaHR0cHM6Ly9jMzI4NzQwLnNzbC5jZjEucmFja2Nkbi5jb20vbWF0aGpheC9sYXRlc3QvTWF0aEpheC5qcz9jb25maWc9VGVYLUFNUy1NTUxfU1ZHIj4KPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+ClxbKHRhbih4KSoyeCszKV4yICogXGludCAoeCkgZHhcXQoKPC9ib2R5Pgo8L2h0bWw+Cg==" width="400" height="100" alt="Slide 2">

It didn’t work and I don’t know why. Does any one know any solution for this?

  • 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-13T06:31:57+00:00Added an answer on June 13, 2026 at 6:31 am

    As sachleen said, your base64 decodes to an HTML page, not an image. And that HTML page does not contain any bitmap images (the <img> tag only works with bitmap images like jpg, png and gif; a web page is never an image):

    <!DOCTYPE html>
    <html>
    <head>
    <title>MathJax Latex Display Test Page</title>
    
    <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG">
    </script>
    </head>
    <body>
    \[(tan(x)*2x+3)^2 * \int (x) dx\]
    
    </body>
    </html>
    

    That’s JavaScript code generating an SVG (vector) image. Add the same <script> tag to the other file, inside <head>, and the body text where appropriate. It works on file1, so it should work on file2 as well.

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

Sidebar

Related Questions

I am new to Javascript coding and have looked for this information in many
I'm trying to improve my Javascript coding style and have been reading that it's
I am new in phonegap development. I have one html page which contains one
I am new to HTML/Javascript, as well as coding in general so bear with
I'm pretty new to Jquery and Javascript and was am working on a project
I am still a bit new to dojo, javascript and HTML coding. I inherited
Very new to javascript and html-type stuff. I wanted to just make a quick
Using javascript, how to open a text-file or html-file from a web-page and load
Let's say I have the following HTML code <div id="outer"> <div id="inner">Hello World</div> </div>
I have been working on Ruby on rails project for a while now, when

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.