Skip to main content
Participant
August 5, 2017
Answered

Linking Between Two Webpages in Iframes Located in Two Spry Accordions

  • August 5, 2017
  • 2 replies
  • 492 views

I have two separate spry accordions on the same web page each with several tabs, one set of panels on the left one on the right. Each tab has panel has an iframe linking to a different web page. I need to link back and forth between the web pages through the iframes in two accordion using anchors.

The following are the names associated with the link :

The main web page is named health.html

The first accordion has an ID of "accordion1",

A tab on accordion1 has an iframe named "articleantinutrients" that connects to a web page call articleantinutrients.html"

The first anchor name I need to link to is called "lectins" <A NAME=lectins>lectins</A> located on the articleantinutrients.html web page

The second accordion has an ID of "accordion2" (This accordion has indexes connected through iframes. I will be linking keywords to content withint articles residing on my website that are viewed through the iframes located in accordion1

The second tab on accordion2 is named “Antinutrients Index”, it has an iframe named "indexantinutrients" that connects to a web page called "Indexantinutrients.html"

The anchor link,<a href="#lectins">lectins</A>, is located on indexantinutrients.html web page

Originally I had the content in the accordion panels without using Iframes and could link them, but I will be putting a lot of content into each of these panels in some cases book length and needed to break them up so that they don't load all at the same time and and then would load faster. I have no idea how to link it this way going through both iframes and accordions. I linked it fine when just using the accordions but can't figure out how to get through the accordions into the iframes and then onto the anchor name especially coming from another iframe in another according panel. I have searched the internet but everything I found only linked from the webpage to a web page in an iframe in an accordion, not two accordions or just between two iframes without accordions being involved.

I can post the coding for each of the web pages if needed.

    This topic has been closed for replies.
    Correct answer Nancy OShea

    Susanmanwil  wrote

    So by hosting the webpages that I will be linking to on my own site can I use frame and accordions together?

    I wouldn't.   What you want is AJAX.  Not JAVA which is something entirely different.

    An AJAX call uses JavaScript or jQuery to pull content from another TXT file or in some cases an XML or JSON file into the parent page.

    https://tutorialzine.com/2009/09/simple-ajax-website-jquery

    Below an example of AJAX with jQuery UI Accordions.

    An ajax example with jQuery accordion

    Nancy

    2 replies

    Participant
    August 5, 2017

    During my research I do believe it was AJAX they were talking about. And I have read where some people thought the spry accordion with iframe were fine to use as long as you didn't use Frames. But then others like you said it was best to use AJAX and JQuery. So as much as I wanted to hang onto the spry accordion files I have been working on for a few years now, I guess I need to just spend the extra time learning AJAX with JQuery and whatever else I need to make the website right. The more I think about it, I would hate to spend a lot of time probablyseveral more years on something I will end up having to completely redo. I am just anxious to get it up and going now that I have the time to work on it full time. I am just kind of worried that I won't be able to design it the way I envisioned it, but I won't know until I try. So thank you for recommendation. I think I will follow your advice.

    Nancy OShea
    Community Expert
    Community Expert
    August 5, 2017

    iFrames & Spry alone or in combination are not a good approach.

    Adobe abandoned Spry in 2012 & subsequently removed the framework from DW.  The Spry code base had not been updated since 2006.

    iFrames are OK for some things but not OK for others.  Browsers have increased security to make the web safer.  One such security measure is Same Origin-Policy.   Calling content from another web domain into an iframe on your site is prone to failures.   Here's why.

    Same-origin policy - Web security | MDN

    You can use content hosted on your domain in an iFrame but owing to the general limitations of iframes, you're much better off just linking directly to the page.  iFrames are not mobile friendly either.  So don't use iFrames if you can can avoid them.  

    Nancy

    Nancy O'Shea— Product User & Community Expert
    Participant
    August 5, 2017

    For the topics I need to be able to link iframes within Spry Accordions, the webpages will be hosted on my site.  I want my readers to be able to view both accordions side by side, one acting as an website index and the other with the tabs acting as a kind of  table of contents opening to articles or books on my website that can be linked to from the index. Though some indexes I will be hosting will be link to other websites I don't need those indexes to use iframe because I will not be storing the content on my site and won't have a lagging issue.

    Is there another way to be able to embed web pages into an accordion type format other than iframes and accordion?  I have heard of ways to do this using other coding languages such as Java and/or jguery but I am just learning html and though I have tried studying these two languages I can't seem to grasping them very rapidly. I was hoping to not have to tackle it right now, it is taking a huge amount of time that I could be using to build my site.

    So by hosting the webpages that I will be linking to on my own site can I use frame and accordions together?

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    August 5, 2017

    Susanmanwil  wrote

    So by hosting the webpages that I will be linking to on my own site can I use frame and accordions together?

    I wouldn't.   What you want is AJAX.  Not JAVA which is something entirely different.

    An AJAX call uses JavaScript or jQuery to pull content from another TXT file or in some cases an XML or JSON file into the parent page.

    https://tutorialzine.com/2009/09/simple-ajax-website-jquery

    Below an example of AJAX with jQuery UI Accordions.

    An ajax example with jQuery accordion

    Nancy

    Nancy O'Shea— Product User & Community Expert