views:

32

answers:

1

Hello,

I need to include the content, scripts, forms and dynamic abilities of one page in another onClick.

Take a look at http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/dahab-master-scuba-diver.html

Then follow one of the links that says 'Beginner' 'Open Water Diver' etc....

You will find a PHP page with a series of options. It is an adaption of the wordpress blog system to produce only specific options for specific programmes by considering each type of each diving programme a category and then displaying only results from that category.

You will see that each option is also a collapsible panel and there are also several javascripts that calculate durations, quantities and prices. There is also a validating webform at the end.

Now go back to the first page. What I would like to do is include all the content from the second page after the main header inside tabbed panels on the first page so that the customers can immidietly see everything that is included. Essentially the options on the first page would become a series of tabs.

The only way I can see to do this is with an iFrame as each option would need a unique URL ending (that is .php?cat=26 or .php?cat=27). THe problem is that the collapsible panels will not work with an iFrame as the iFrame will not resize when the panels open. There were also some calculation problems, but I think that was more down to me staring at the screen for the last 3 hours not remembering to include everything.

I have tried it with resizing iframe SSI scripts and have got nowhere.

I tried actually embedding it in the page better with a ajax script, but that left behind all the scripts that make it work. I checked with full URL's on everything and it would not take work with any scripts.

I know that you could just make the whole page reload but then the user would be at the top of the page again, and even if another script was applied to slowly bring them down again it would not be anything near as easy to use as if it was like tabbed panels.

Any ideas.

Kind Regards,

A: 

Definitely no need for iframes. AJAX will do the trick here.

Here's a link with a demo + code:

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

Citizen
That's the one I have been using. The ajax is not loading the code that makes the accordion work. In fact as far as I can tell none of the javascript is working with this script. I put the scripts into the head sections of both the original document and the parent document and still nothing.It could be that I missed something, but I spent hours on it. Are you absolutely sure that the ajax script can support them? Thanks.
Robin I Knight
It is as if all script triggers have been removed and left behind but like I said the HEAD section of the parent page contains all of the scripts as well.Any ideashttp://www.divethegap.com/scuba-diving-programmes-dive-the-gap/programme-pages/dahab-divemaster/test.php
Robin I Knight
Start with the working ajax code and THEN add your actual content and rest of the page.
Citizen
I tested it with a single collapsible panel and it simply does not work when loaded into another page with the necessary scripts included in both pages using that ajax script
Robin I Knight