469,963 Members | 1,885 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

Open --non-default page-- in iFrame

Hi All.

I have a web with the default startup page as : index.htm that contains
an iFrame.

The default page, that loads in the iFrame, when index.htm is loaded, is
htmPage1.htm

I want to be able hyperlink from a banner ad on a different site to show a
different page in the iFrame when the index.htm page opens.

For example, a user clicks on my banner ad ( on a different web site ) and
it opens my index.htm with htmPage3.htm loaded into the iFrame instead of
htmPage1.htm.

Any suggestions would be greatly appreciated.

Regards
DaveO
Jul 23 '05 #1
2 1857
Jc
DaveO wrote:
I have a web with the default startup page as : index.htm that contains
an iFrame.

The default page, that loads in the iFrame, when index.htm is loaded, is
htmPage1.htm

I want to be able hyperlink from a banner ad on a different site to show a
different page in the iFrame when the index.htm page opens.

For example, a user clicks on my banner ad ( on a different web site ) and
it opens my index.htm with htmPage3.htm loaded into the iFrame instead of
htmPage1.htm.


The preferable way would be to generate the page server side based on
the referrer property (the URL that the user is coming from, as sent by
their browser in the header information), at which point you could set
the src of the iframe as desired.

You can also access the referrer property through javascript, and then
set the src of the iframe through the DOM. Refer to:
http://msdn.microsoft.com/library/de...s/referrer.asp

Alternatively, assuming your banner ad sends one or more URL parameters
to your site when someone clicks on it, you could look for the presence
of those and set the iframe src accordingly. Refer to:
http://msdn.microsoft.com/library/de...ies/search.asp

Jul 23 '05 #2
Hi Jc

Thanks for the feedback.

I have eventually figured this out - Not sure if this is the best way, but
it works for me.

I have changed the hyperlink on my banner ad to include -->
?&gopage=htmPage2

Then in the index.htm page, I added javascript to extract the passed url and
break it down into an array.

Later in the html where the iFrame is created ( with it's default page ), I
have added javascript code to change the default page.

Regards
DaveO
---------------------------------------------------

"Jc" <go****@weinrichs.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
DaveO wrote:
I have a web with the default startup page as : index.htm that contains
an iFrame.

The default page, that loads in the iFrame, when index.htm is loaded, is
htmPage1.htm

I want to be able hyperlink from a banner ad on a different site to show a
different page in the iFrame when the index.htm page opens.

For example, a user clicks on my banner ad ( on a different web site ) and
it opens my index.htm with htmPage3.htm loaded into the iFrame instead of
htmPage1.htm.


The preferable way would be to generate the page server side based on
the referrer property (the URL that the user is coming from, as sent by
their browser in the header information), at which point you could set
the src of the iframe as desired.

You can also access the referrer property through javascript, and then
set the src of the iframe through the DOM. Refer to:
http://msdn.microsoft.com/library/de...s/referrer.asp

Alternatively, assuming your banner ad sends one or more URL parameters
to your site when someone clicks on it, you could look for the presence
of those and set the iframe src accordingly. Refer to:
http://msdn.microsoft.com/library/de...ies/search.asp
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Kojak | last post: by
2 posts views Thread by Mike Lambert | last post: by
2 posts views Thread by JezB | last post: by
10 posts views Thread by ┼×enol Akbulak | last post: by
2 posts views Thread by Jean Paul Mertens | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.