Results 1 to 5 of 5

Thread: How to Insert Virtual Include txt. file to IFrame

  1. #1
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to Insert Virtual Include txt. file to IFrame

    Script: DD IFrame SSI Script II

    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    --------------------------

    Hello, this might be an html question, as related to this script...

    We thought this would be the perfect solution to split our extra-long banner page into a few more, and people can toggle them around within one iframe by using text link to each.

    Instead of creating new html banner pages, however, is it possible to virtually insert txt. files from the Include directory:

    --------------------------

    <!--#include virtual="/include/bannerpage1.txt" -->

    --------------------------

    ...just as we are doing now, so that there would be no risk of letting new sub-iframe html pages affect your current good search engine ranking.

    When we foolishly replaced the document part with the above command, the page ended up displaying all the txt. files at once (not an iframe at all). Obviously that was not the way to achieve this...

    If this could be done, how would you modify “Step 2” of the script:

    --------------------------

    <iframe id="myframe" src="bannerpage1.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:500px; display:none"></iframe>

    --------------------------

    and the text link to that page:

    <a href="javascript:loadintoIframe('myframe', 'bannerpage1.html')">Banner Page 1</a>

    --------------------------

    Thank you for your help!!!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Well, an iframe simply loads the page referenced in its src property, for example:

    Code:
    <iframe src="dir/page.shtml">
    Now, within page.shtml itself, you're free to invoke SSI to then include the text file of your choice:

    Code:
    <!--#include virtual="/include/bannerpage1.txt" -->
    Not sure if this answers your question.

  3. #3
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your response,

    Unfortunately, for search engine reasons, it might be preferable to load txt files directly into your iframe script (few of them to toggle around), without using html/shtml document containing the txt files.

    We would be so grateful if, in other words, the following command could be executed within your iframe script, rather than within an html/shtml page:

    ----------------

    <!--#include virtual="/include/bannerpage1.txt" -->

    ----------------

    So far, this script seems to be the best solution for splitting our extra-long page into a few more, so hopefully this can be done…

    Your time is truly appreciated!

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <iframe src="/include/bannerpage1.txt">
    Like that? Note the necessity for bannerpage1.txt to be accessible from the web.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Or like Twey says, you're free to directly include a .txt file via SSI includes. As long as it's a text file of some sort, it will work.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •