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

  • Home
  • SEARCH
  • 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 6844539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:23:27+00:00 2026-05-27T00:23:27+00:00

I have an iframe to preview some data. The data is stored in a

  • 0

I have an iframe to preview some data.

The data is stored in a javascript variable :

var s = '<html><head></head><body><a href="#">Hello_world</a></body></html>';

I am passing the data [passing s] to the iframe SRC attribute via Javascript.

Here is the code :

document.getElementById('output_iframe1').src = "data:text/html;charset=utf-8," + escape(s);

So the data is loaded on the iframe except <a> elements.

The Problem is I can see text but not links. However, the element events are working fine(click,hover etc).

I inspected through Firebug and all are working well there.

I changed the HREF attribute to http://somesite/file.html on Firebug and amazingly it worked, but not with #.

Actually what i am doing wrong ??
Why i cant see LINKS without http:// ?

Thank you .

Update 1 : I tested it with latest Firefox 8.0 and it works well,also checked with Google Chrome [Works well,but clicking on any links disappearing all the links],Yeah as usual IE failed in all cases,it looks like IE doesn't know what is an Iframe

  • 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-27T00:23:28+00:00Added an answer on May 27, 2026 at 12:23 am

    Use href=”javascript:void(0)” instead of href=”#”.

    OR

    Since you are assigning it to a src attribute, you need to encode the string before you apply it. This is because, usually src value is url and “#” is used in browsers url sometimes. Hope you understand what I am saying.
    Use encodeURIComponent() or encodeURI(). See the syntax here
    http://www.w3schools.com/jsref/jsref_encodeuricomponent.asp

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

Sidebar

Related Questions

I have an IFrame app, and I would like to use some Connect features
I have an iframe that returns data to the top.document window just fine by
Actually i have iframe which has some important content in it ,but problem is
IM writing some html which provides a preview function for a list of URLs.
I have iframe with id=iView and designMode = on. My code: var iframeWindow =
I have an iframe in my HTML, and I want to be notified when
Is there some way to preview documents in browser? Specifically in say an iframe
I have an iframe that pops up on an HTML page. In the iframe
I have an iframe. The content is wider than the width I am setting
I have an iframe window that displays a report. To access this iframe, I

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.