开发者

Load on page inside another onClick

开发者 https://www.devze.com 2022-12-26 19:20 出处:网络
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-di

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, 开发者_如何学Cand 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,


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

0

精彩评论

暂无评论...
验证码 换一张
取 消