Link to home
Start Free TrialLog in
Avatar of SubbuUSA
SubbuUSAFlag for United States of America

asked on

Loading an iFrame in HTML

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
SOLUTION
Avatar of Kim Walker
Kim Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SubbuUSA

ASKER

@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 :(
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.
@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.
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.
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");

                }
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?
@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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks