Open --non-default page-- in iFrame

D

DaveO

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
 
J

Jc

DaveO said:
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/d...uthor/dhtml/reference/properties/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/d.../author/dhtml/reference/properties/search.asp
 
D

DaveO

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
---------------------------------------------------

DaveO said:
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/d...uthor/dhtml/reference/properties/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/d.../author/dhtml/reference/properties/search.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top