Skip to main content
Inspiring
January 18, 2018
Answered

How can I load html page within page without iframes?

  • January 18, 2018
  • 3 replies
  • 557 views

I have heard that iframes are not supported with some browsers and I am programming also for mobile sites.

I have the need to have a standard page which loads other pages into a sort-of-frame within it.

I do not want to use iframes since it apparently will not work for everyone.

No idea where to start - please can anyone assist me.

I am using Dreamweaver CS6

Thank you in advance

    This topic has been closed for replies.
    Correct answer osgood_

    terryfoster  wrote

    I have heard that iframes are not supported with some browsers and I am programming also for mobile sites.

    I have the need to have a standard page which loads other pages into a sort-of-frame within it.

    I do not want to use iframes since it apparently will not work for everyone.

    No idea where to start - please can anyone assist me.

    I am using Dreamweaver CS6

    Thank you in advance

    If the pages are yours and you have access to them (not hosted on someone elses website) and don't want to use a server language like php you could use the jQuery load function to pull the pages in.

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    January 18, 2018

    What exactly are you trying to do?  You'll get better answers if we understand what the target file contains and what you're hoping to do with it.

    For example, if you're tying to add a Facebook feed to your web page, you'll need to begin at the source site.

    How to Embed Facebook Feed on a Website - EmbedSocial

    Nancy O'Shea— Product User & Community Expert
    Inspiring
    January 18, 2018

    I have a client with a website for a restaurant.

    I want to write an admin page which will store the data in a csv file.

    This file then gets used to generate the menu options for the customer (Food Menu)

    I want to generate the Food Menu options page as an insert to the complete page.

    Ideally I need access to a database but they don't want this - so I am finding workarounds so the admin page will read/store values in a csv and then create the food options in a seperate page which can then be displayed later.

    Confused?! So am I!

    Terry

    Nancy OShea
    Community Expert
    Community Expert
    January 18, 2018

    OK.  I would use a PHP script with the fgetcsv() function to bring data into an HTML table.

    PHP: fgetcsv - Manual

    <?php
    echo
    "<html><body><table>\n\n";
    $f
    = fopen("so-csv.csv", "r");
    while (($line = fgetcsv($f)) !== false) {
      echo
    "<tr>";
      
    foreach ($line as $cell) {
      echo
    "<td>" . htmlspecialchars($cell) . "</td>";
      
    }
      echo
    "</tr>\n";
    }
    fclose
    ($f);
    echo
    "\n</table></body></html>";

    Keep in mind the parent page will need a .php file extension and your server must support PHP code.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    osgood_Correct answer
    Legend
    January 18, 2018

    terryfoster  wrote

    I have heard that iframes are not supported with some browsers and I am programming also for mobile sites.

    I have the need to have a standard page which loads other pages into a sort-of-frame within it.

    I do not want to use iframes since it apparently will not work for everyone.

    No idea where to start - please can anyone assist me.

    I am using Dreamweaver CS6

    Thank you in advance

    If the pages are yours and you have access to them (not hosted on someone elses website) and don't want to use a server language like php you could use the jQuery load function to pull the pages in.

    Inspiring
    January 19, 2018

    How would I get the jquery code to load the section of html code into a  div?

    Thank you for all feedback.

    BenPleysier
    Community Expert
    Community Expert
    January 19, 2018

    Have a look at the link in my reply.

    <html>
     
    <head>
      
    <script src="jquery.js"></script>
      
    <script>
      $
    (function(){
      $
    ("#includedContent").load("b.html");
      
    });
      
    </script>
     
    </head>

     
    <body>
      
    <div id="includedContent"></div>
     
    </body>
    </html>
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    BenPleysier
    Community Expert
    Community Expert
    January 18, 2018

    If the content from an iframe is loaded from the same domain, this will ot be rejected.

    Have a look at Include another HTML file in a HTML file - Stack Overflow for another way to achieve the same goal. Personally I use PHP includes to do the task, but this requires that you have access to a PHP server.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!