Solved

Loading an iFrame in HTML

Posted on 2012-03-30
10
217 Views
Last Modified: 2012-04-01
Dear Experts,

I have a requirement for my customer to load an Iframe from an external party / vendor in to a small portion of real estate in our website.

 When I tried to use iFrame or frameset..it loads the same parent page inside the iframe instead of the URL given by my vendor.

It is intriguing and confusing me. Let me know if something else can be done in HTML and Javascript to achieve this functionality.

Thanks
0
Comment
Question by:SubbuUSA
  • 5
  • 4
10 Comments
 
LVL 21

Assisted Solution

by:Kim Walker
Kim Walker earned 250 total points
Comment Utility
Are you entering the entire url including the "http://"?
0
 

Author Comment

by:SubbuUSA
Comment Utility
@xmediaman

Yes I am passing my URL  "http://www.anything.com/" through my querystring . Either I give this way or simply "www.anything.com/" or Just "anything.com/". Same result :(
0
 
LVL 21

Expert Comment

by:Kim Walker
Comment Utility
Why would you include your own url in the query string? If the site you're loading wants to know your url, you must leave the "http://" out of the query string. Any part of the url before that http:// will be ignored.
0
 

Author Comment

by:SubbuUSA
Comment Utility
@xmediaman

Sorry my english was bad. what I meant was..I am allowing my vendor to pass the URL in to my iframe to load. The URL my vendor passes does contain http://www.auto.com

I am not passing my URL in to the querystring. sorry my bad if it has confused you.
0
 
LVL 21

Expert Comment

by:Kim Walker
Comment Utility
I missed that part in your initial post. So it sounds like there are three parties.
1. You have a website
2. You have a customer
3. There's an external party/vendor

How is your customer accessing your site to modify the iframe tag to load the external party/vendor page?

Please post the html for your page that includes the iframe that is loading improperly.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:SubbuUSA
Comment Utility
HTML

<html>
      <head>
            <title><tri:BrandText name="ProductName" /></title>
      </head>
      <iframe width="600" height="600" src="http://www.thirdparty.com"></ iframe>
</html>

Code behind

if (res.QURL != null)
                {
                    var repUrl = new Url("http://www.thirdparty.com");
                    contentRequest.NamedObjects["QuizURL"] = repUrl;
                    return new InvocationResponse("ShowFrameIn");

                }
0
 
LVL 21

Expert Comment

by:Kim Walker
Comment Utility
Is it the customer's website or your website?

The HTML looks fine and the third party/vendor url is already there. Please explain the code behind. Where does it reside and how does it interact with the website?
0
 

Author Comment

by:SubbuUSA
Comment Utility
@xmediaman

Thanks for your repsonse. I dont have a website. External party is loading my customer's website. the repUrl in code behind comes from a querystring. sorry about the hardcoding part. invocation reponse is actually loading a content file. It resides in  my customer's solution.we get querystring from a webservice hosted by third party. I hope I answered all your questions.
0
 
LVL 21

Accepted Solution

by:
masterpass earned 250 total points
Comment Utility
First of all, make sure that your customer supports iframe rendering!

Try to modify like this

<iframe src="http://www.w3schools.com"></iframe>

see if the w3 schools is getting rendered in your code. If w3 schools is getting rendered then the problem is not with your code and you will have to talk to your customer to allow iframe rendering.

some famous sites which does not allow Iframe rendering are google and hotmail!

Hope this helps!
0
 

Author Closing Comment

by:SubbuUSA
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now