Open in new page

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Is it possible to set up a hyperlink so that it opens up in a special
results page. I need to be able to set up the results page so that the
subject matter (the hyperlink) opens in a pre-defined iFrame in the centre
of the results page. TIA. Fred
 
Here's a simple approach, if it will meet your needs:

Put your news item text on a page such as "news.htm." Call the news.htm
page from the iFrame, set into the Special Results page. Then your
hyperlink calls the special results page, with whatever text you want
surrounding the news item, and the frame calls the news page. Like so:

<body>

&nbsp;<p>This is the results page. In the center is the news item.</p>
<p>&nbsp;</p>
<p>

<iframe name="New Information" src="news.htm" width="350" height="200"
align="center"></iframe>

</p>

</body>

The only "catch" is that your subject matter must be placed in the news.htm
page first. If you want the iFrame to open a variety of page names, that
would be much trickier.
 
Hi Thor, Unfortunately I need the trickier option. I need to put the cart
before the horse with this one. I need to try and find a way for the <a href
to include the destination (results) page plus the usual hyperlink. I've
seen this done but can't remember where. Fred
 
Well, you can tailor which page you call into the iframe
<button onclick="loadIframe('News','news.html')">Open/Close News of this Site</button>
<iframe class="c1" id="News" src=""></iframe>
function loadIframe(id,sPath)
{
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}

The parameter sPath (e.g. 'news.html') determines which page gets loaded.

The problem now is passing this parameter into the page. I recently posted on a similar query (or at least my answer was similar)
Call the page like this
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id)
{
var sPath = qsobj(0)
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}
</script>
</head>
<body>
<button onclick="loadIframe('News')">Open/Close News of this Site</button>
<iframe id="News" src=""></iframe>
</body>
</html>

I have tested this and it works.
But there is still a button on results.html which you have to click.

If you want it to load automatically, use this in the <body>
<body onload="loadIframe('News')">
<iframe id="News" src=""></iframe>
</body>

If I have misunderstood what you want, please let me know and I will have another try
 
Hi Trevor, First of all a big thank you for trying to help a novice.

On my website I have several links to hotel descriptions which open on a
_blank page.
Such a link is as shown below
<a
href="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN"
target="_blank">More info</a>

What I'm trying to achieve is to get the hotel description to open up on
another page
which has a header and footer instead of a blank page.

I'm not sure if I misled you before but I think I need to add some
script/code to the
front of the a href so that it directs it to the results page where it will
be
displayed. I suppose I'm looking for a way to get a page to open within a
page if that
makes sense. Please help if you can. Fred

Trevor L. said:
Well, you can tailor which page you call into the iframe
<button onclick="loadIframe('News','news.html')">Open/Close News of this
Site</button>
<iframe class="c1" id="News" src=""></iframe>
function loadIframe(id,sPath)
{
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}

The parameter sPath (e.g. 'news.html') determines which page gets loaded.

The problem now is passing this parameter into the page. I recently posted
on a similar query (or at least my answer was similar)
Call the page like this
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id)
{
var sPath = qsobj(0)
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}
</script>
</head>
<body>
<button onclick="loadIframe('News')">Open/Close News of this Site</button>
<iframe id="News" src=""></iframe>
</body>
</html>

I have tested this and it works.
But there is still a button on results.html which you have to click.

If you want it to load automatically, use this in the <body>
<body onload="loadIframe('News')">
<iframe id="News" src=""></iframe>
</body>

If I have misunderstood what you want, please let me know and I will have
another try
Hi Thor, Unfortunately I need the trickier option. I need to put the
cart before the horse with this one. I need to try and find a way for
the <a href to include the destination (results) page plus the usual
hyperlink. I've seen this done but can't remember where. Fred
 
You would link tot he description content on a new page the same way as the link below. Just create
a page with the static content that you want to always appear, then pass the record ID for the
description content to the page.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================


Fred said:
Hi Trevor, First of all a big thank you for trying to help a novice.

On my website I have several links to hotel descriptions which open on a _blank page.
Such a link is as shown below
<a href="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN"
target="_blank">More info</a>

What I'm trying to achieve is to get the hotel description to open up on another page
which has a header and footer instead of a blank page.

I'm not sure if I misled you before but I think I need to add some script/code to the
front of the a href so that it directs it to the results page where it will be
displayed. I suppose I'm looking for a way to get a page to open within a page if that
makes sense. Please help if you can. Fred

Trevor L. said:
Well, you can tailor which page you call into the iframe
<button onclick="loadIframe('News','news.html')">Open/Close News of this Site</button>
<iframe class="c1" id="News" src=""></iframe>
function loadIframe(id,sPath)
{
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}

The parameter sPath (e.g. 'news.html') determines which page gets loaded.

The problem now is passing this parameter into the page. I recently posted on a similar query (or
at least my answer was similar)
Call the page like this
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id)
{
var sPath = qsobj(0)
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}
</script>
</head>
<body>
<button onclick="loadIframe('News')">Open/Close News of this Site</button>
<iframe id="News" src=""></iframe>
</body>
</html>

I have tested this and it works.
But there is still a button on results.html which you have to click.

If you want it to load automatically, use this in the <body>
<body onload="loadIframe('News')">
<iframe id="News" src=""></iframe>
</body>

If I have misunderstood what you want, please let me know and I will have another try
Hi Thor, Unfortunately I need the trickier option. I need to put the
cart before the horse with this one. I need to try and find a way for
the <a href to include the destination (results) page plus the usual
hyperlink. I've seen this done but can't remember where. Fred


Here's a simple approach, if it will meet your needs:

Put your news item text on a page such as "news.htm." Call the
news.htm page from the iFrame, set into the Special Results page. Then your hyperlink calls the
special results page, with whatever
text you want surrounding the news item, and the frame calls the
news page. Like so: <body>

&nbsp;<p>This is the results page. In the center is the news
item.</p> <p>&nbsp;</p>
<p>

<iframe name="New Information" src="news.htm" width="350"
height="200" align="center"></iframe>

</p>

</body>

The only "catch" is that your subject matter must be placed in the
news.htm page first. If you want the iFrame to open a variety of page
names, that would be much trickier.

Is it possible to set up a hyperlink so that it opens up in a
special results page. I need to be able to set up the results page
so that the subject matter (the hyperlink) opens in a pre-defined
iFrame in the centre of the results page. TIA. Fred
 
Hi Thomas,

I've already created the static page "results.htm" but if I just add the URL
results.htm to the start of the <a href link I can't get it to work. The
link I'm using opens up the results page but doesn't gather the hotel part.
The link is:
<a href="http://www.linden-travel-group.co.uk/results.htm"
src="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN">More
info</a>

Sorry I'm being a bit thick on this but for once I can blame the heat in
England as we are hitting new records daily and unfortunately we don't have
A/C in our homes like they do in Florida. Fred


Thomas A. Rowe said:
You would link tot he description content on a new page the same way as
the link below. Just create a page with the static content that you want
to always appear, then pass the record ID for the description content to
the page.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================


Fred said:
Hi Trevor, First of all a big thank you for trying to help a novice.

On my website I have several links to hotel descriptions which open on a
_blank page.
Such a link is as shown below
<a
href="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN"
target="_blank">More info</a>

What I'm trying to achieve is to get the hotel description to open up on
another page
which has a header and footer instead of a blank page.

I'm not sure if I misled you before but I think I need to add some
script/code to the
front of the a href so that it directs it to the results page where it
will be
displayed. I suppose I'm looking for a way to get a page to open within a
page if that
makes sense. Please help if you can. Fred

Trevor L. said:
Well, you can tailor which page you call into the iframe
<button onclick="loadIframe('News','news.html')">Open/Close News of
this Site</button>
<iframe class="c1" id="News" src=""></iframe>
function loadIframe(id,sPath)
{
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}

The parameter sPath (e.g. 'news.html') determines which page gets
loaded.

The problem now is passing this parameter into the page. I recently
posted on a similar query (or at least my answer was similar)
Call the page like this
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id)
{
var sPath = qsobj(0)
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}
</script>
</head>
<body>
<button onclick="loadIframe('News')">Open/Close News of this
Site</button>
<iframe id="News" src=""></iframe>
</body>
</html>

I have tested this and it works.
But there is still a button on results.html which you have to click.

If you want it to load automatically, use this in the <body>
<body onload="loadIframe('News')">
<iframe id="News" src=""></iframe>
</body>

If I have misunderstood what you want, please let me know and I will
have another try

Fred wrote:
Hi Thor, Unfortunately I need the trickier option. I need to put the
cart before the horse with this one. I need to try and find a way for
the <a href to include the destination (results) page plus the usual
hyperlink. I've seen this done but can't remember where. Fred


Here's a simple approach, if it will meet your needs:

Put your news item text on a page such as "news.htm." Call the
news.htm page from the iFrame, set into the Special Results page. Then
your hyperlink calls the special results page, with whatever
text you want surrounding the news item, and the frame calls the
news page. Like so: <body>

&nbsp;<p>This is the results page. In the center is the news
item.</p> <p>&nbsp;</p>
<p>

<iframe name="New Information" src="news.htm" width="350"
height="200" align="center"></iframe>

</p>

</body>

The only "catch" is that your subject matter must be placed in the
news.htm page first. If you want the iFrame to open a variety of page
names, that would be much trickier.

Is it possible to set up a hyperlink so that it opens up in a
special results page. I need to be able to set up the results page
so that the subject matter (the hyperlink) opens in a pre-defined
iFrame in the centre of the results page. TIA. Fred
 
All of your pages need to be .asp and your link will not work as you have it shown below.

If you didn't create the ASP application that generates the following:
http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN

Then I suggest you contact the developer who would be in the best position to help you accomplish
your goal

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================


Fred said:
Hi Thomas,

I've already created the static page "results.htm" but if I just add the URL results.htm to the
start of the <a href link I can't get it to work. The link I'm using opens up the results page but
doesn't gather the hotel part. The link is:
<a href="http://www.linden-travel-group.co.uk/results.htm"
src="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN">More info</a>

Sorry I'm being a bit thick on this but for once I can blame the heat in England as we are hitting
new records daily and unfortunately we don't have A/C in our homes like they do in Florida. Fred


Thomas A. Rowe said:
You would link tot he description content on a new page the same way as the link below. Just
create a page with the static content that you want to always appear, then pass the record ID for
the description content to the page.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================


Fred said:
Hi Trevor, First of all a big thank you for trying to help a novice.

On my website I have several links to hotel descriptions which open on a _blank page.
Such a link is as shown below
<a href="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN"
target="_blank">More info</a>

What I'm trying to achieve is to get the hotel description to open up on another page
which has a header and footer instead of a blank page.

I'm not sure if I misled you before but I think I need to add some script/code to the
front of the a href so that it directs it to the results page where it will be
displayed. I suppose I'm looking for a way to get a page to open within a page if that
makes sense. Please help if you can. Fred

Well, you can tailor which page you call into the iframe
<button onclick="loadIframe('News','news.html')">Open/Close News of this Site</button>
<iframe class="c1" id="News" src=""></iframe>
function loadIframe(id,sPath)
{
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}

The parameter sPath (e.g. 'news.html') determines which page gets loaded.

The problem now is passing this parameter into the page. I recently posted on a similar query
(or at least my answer was similar)
Call the page like this
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id)
{
var sPath = qsobj(0)
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = sPath
x.style.display = 'block'}
else
x.style.display = 'none'
}
</script>
</head>
<body>
<button onclick="loadIframe('News')">Open/Close News of this Site</button>
<iframe id="News" src=""></iframe>
</body>
</html>

I have tested this and it works.
But there is still a button on results.html which you have to click.

If you want it to load automatically, use this in the <body>
<body onload="loadIframe('News')">
<iframe id="News" src=""></iframe>
</body>

If I have misunderstood what you want, please let me know and I will have another try

Fred wrote:
Hi Thor, Unfortunately I need the trickier option. I need to put the
cart before the horse with this one. I need to try and find a way for
the <a href to include the destination (results) page plus the usual
hyperlink. I've seen this done but can't remember where. Fred


Here's a simple approach, if it will meet your needs:

Put your news item text on a page such as "news.htm." Call the
news.htm page from the iFrame, set into the Special Results page. Then your hyperlink calls
the special results page, with whatever
text you want surrounding the news item, and the frame calls the
news page. Like so: <body>

&nbsp;<p>This is the results page. In the center is the news
item.</p> <p>&nbsp;</p>
<p>

<iframe name="New Information" src="news.htm" width="350"
height="200" align="center"></iframe>

</p>

</body>

The only "catch" is that your subject matter must be placed in the
news.htm page first. If you want the iFrame to open a variety of page
names, that would be much trickier.

Is it possible to set up a hyperlink so that it opens up in a
special results page. I need to be able to set up the results page
so that the subject matter (the hyperlink) opens in a pre-defined
iFrame in the centre of the results page. TIA. Fred
 
Fred said:
Hi Trevor, First of all a big thank you for trying to help a novice. [snip]
Please help if you can. Fred

Thomas is a lot more experienced than I but I will have a look anyway a little later today (Australian time)

What, hot in England ??

I shouldn't jest. We were there in 2004 and on D-Day, it was 30 deg in London - a little cooler at about 27 or 28 where we were in
Jersey.
It's a maximum of 14 here in Canberra today - overnight it was about minus 2 or 3.
But Canberra has very nice winter days - absolutely calm with clear blue skies.
 
Fred said:
Hi Trevor, First of all a big thank you for trying to help a novice.

On my website I have several links to hotel descriptions which open
on a _blank page.
Such a link is as shown below
<a
href="http://212.161.124.21/ob/hotel_desc.asp?HID=20051111120903108689&Lang=EN"
target="_blank">More info</a>

What I'm trying to achieve is to get the hotel description to open up
on another page
which has a header and footer instead of a blank page.

I'm not sure if I misled you before but I think I need to add some
script/code to the
front of the a href so that it directs it to the results page where
it will be
displayed. I suppose I'm looking for a way to get a page to open
within a page if that
makes sense. Please help if you can. Fred

Here is the code which does what I think you want.

Here is the page which calls the results page
<html>
<head></head>
<body>
<a href="results.html?page=news.html">call news</a>
</body>
</html>

As you can see, it is just a test page. You can put links anywhere in your existing page. Just alter the page called (after ?page=)

This is results.html
<html>
<head>
<script type="text/javascript">
function qsobj(parm) {
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
function loadIframe(id) {
var x = document.getElementById(id)
if (x.style.display != 'block')
{ x.src = qsobj(0); x.style.display = 'block'}
else { x.style.display = 'none' }
}
</script>
</head>
<body onload="loadIframe('News')">
<p align="center">Header here</p>
<p>
<iframe id="News" width="350" height="200" align="center">
</iframe>
</p>
<p align="center">Footer here</p>
</body>
</html>

I have tested it and it puts a nice frame in the centre of the page.

I hope that this what you want.
(Please post again if it isn't and I will try to help further.)
 
Back
Top