Solved

Make 2 pages show on 1 page

Posted on 2004-05-01
14
150 Views
Last Modified: 2010-04-06
Hi

Sorry for the doddgy Q tiltle - i don't want frames.

What i meant was

I'm using a script that brings in results 10 at a time by whatever rank i specify (popular, alphabetical etc.)

the address bar shows something like

http://mydomain.com/cgi-bin/us.cgi?locale=us&mode=cat&node=2&sort_type=%2rank&page_num=1

 for the next 10 results you click next and get

http://mydoamiain.com/cgi-bin/us.cgi?locale=us&mode=cat&node=2&sort_type=%2rank&page_num=2


What i'd like to do is bring up page_num=1 and page_num=2 on the same page. And maybe page_num=(upto whatever) as well.

Thanks




0
Comment
Question by:macuser777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 10

Expert Comment

by:eeBlueShadow
ID: 10969117
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 105 total points
ID: 10969161
Just use iframes:

<body>
<iframe src="http://mydomain.com/cgi-bin/us.cgi?locale=us&mode=cat&node=2&sort_type=%2rank&page_num=1">
</iframe>
<iframe src="http://mydoamiain.com/cgi-bin/us.cgi?locale=us&mode=cat&node=2&sort_type=%2rank&page_num=2".
</iframe>

You can use as many iframes as you want to bring in as many pages as you want.

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 10969331
Hi

The iframes is doing the job - but i've never used them before so can you help me format them a bit?

This test page

I'd like the 1-10 and 11-20 to show without scrolling
- no horizontal scroll bar
- AdSense to show up inbetween

http://www.amazoneasyview.com/cd.html

Eventually i want all this to show up as a left fram on another page with one vertical scroll for the whole lot.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10969356
TryL
<iframe src=" http://amazoneasyview.com/cgi-bin/play.cgi?locale=us&mode=books&node=1&sort_type=%2Bsalesrank&page_num=1 " style="height:auto">
</iframe>

If that does not work you may have set it dynamically using Javascript.  However you will have a better chance of getting thing to work reliably if you use valid html.  That page is incomplete there is only a body.

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 10969437
Hi

I should have put the proper head content in to test - sorry - bad habit.

The AdSense works with the proper head content.

Overall it kinda works ok now - i found some iframe width,height attribute stuff to add.
It would be much better with an auto height though.

I'll leave the q. for a bit in case any ideas on the height thing.

Otherwise - invaluable help as ever :) - thanks
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10969519
We still have something else we can try.  Give both the iframes an id.  id="IF1" and id="IF2" and a name:
name="NIF1" and name="NIF2"

Get rid of the height and then do the body of the page this way:
<body onload="setH('IF1','NIF1'); setH('IF2','NIF2');">

Then put this script in the head:

<script type="text/javascript">
function setH(frm,fname)
{
   obj=document.getElementById(frm);
   obj.style.height=top.frames[fname].document.body.scrollHeight+'px';
}
</script>

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 10969588
Id didn't work but i might have coded it wrong...maybe left in some iframe attributes that should be edited out...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<script type="text/javascript">
function setH(frm,fname)
{
   obj=document.getElementById(frm);
   obj.style.height=top.frames[fname].document.body.scrollHeight+'px';
}
</script>



</head>

<body onload="setH('IF1','NIF1'); setH('IF2','NIF2');">

<Div align="center">

<iframe marginwidth="0" marginheight="0" width="190"  scrolling="no" frameborder ="0" id="IF1" name="NIF1"  src=" http://amazoneasyview.com/cgi-bin/play.cgi?locale=us&mode=books&node=1&sort_type=%2Bsalesrank&page_num=1 " > 
</iframe>


<BR><BR>

<iframe marginwidth="0" marginheight="0" width="190" id="IF2" name=" NIF2" scrolling="no" frameborder="0" src=" http://amazoneasyview.com/cgi-bin/play.cgi?locale=us&mode=books&node=1&sort_type=%2Bsalesrank&page_num=2 " >
</iframe>


<div>

</body>

</html>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10969607
Okay, I'll take another look in the morning... I'm about to call it a night.

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 10969618
me too...it's 1.am + in the UK...see ya later

macuser
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10971672
Let's try it from the other direct and run a method inside the iframe window:

<script type="text/javascript">
function setH(frm,fname)
{
   H=top.frames[fname].document.body.scrollHeight;
   top.frames[fname].resizeTo(190,(H+10));
}
</script>

That should work as long as the pages are coming form th esame domain.

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 10973447
The pages are coming from the same domain in a sense.
It's my domain - but it picks up the info from an amazom XML feed which i just plug into.

Didn't work though.

When you say try and run a method from inside the iframe window
i'm assuming you didn't mean to put the code in the <iframe...

this is what i tried

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
function setH(frm,fname)
{
   H=top.frames[fname].document.body.scrollHeight;
   top.frames[fname].resizeTo(190,(H+10));
}
</script>


</head>

<body onload="setH('IF1','NIF1'); setH('IF2','NIF2');">

<iframe marginwidth="0" marginheight="0" width="190"  scrolling="no" frameborder ="0" id="IF1" name="NIF1"  src=" http://amazoneasyview.com/cgi-bin/play.cgi?locale=us&mode=books&node=1&sort_type=%2Bsalesrank&page_num=1 " > 
</iframe>

<BR><BR>

<iframe marginwidth="0" marginheight="0" width="190" id="IF2" name= "NIF2" scrolling="no" frameborder="0" src=" http://amazoneasyview.com/cgi-bin/play.cgi?locale=us&mode=books&node=1&sort_type=%2Bsalesrank&page_num=2 " >
</iframe>

<BR>


</body>
</html>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10973536
If the content is not coming from your domain it is not going to work, because that creates a security violation, and you can't access the element with the external content.  To get around it the content pages would have to set it themselves by doing the body tags as:

<body onload="resizeTo(document.body.scrollWidth, document.body.scrollHeight)">

If you have the capability of modifying the incoming page then that will take care of it, but if you cannot put the code right on the content pages you are out of luck.

Cd&
0
 
LVL 4

Author Comment

by:macuser777
ID: 11216036
Thanks for all the input on the auto resizing - i've been playing with it but no joy. There's a new version of the script coming out soon - maybe it will be possible with that.

macuser
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11216471
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

738 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