Results 1 to 3 of 3

Thread: Loading HTML to div/iFrame

  1. #1
    Join Date
    Sep 2012

    Question Loading HTML to div/iFrame


    I am designing a website for my small office, to be used by 10 people at the most - using Intranet.

    I have a DIV in a page which shows the internal articles search results. The Articles (help documents) are saved as html files in a sub folder and so show up as links in the search results.

    -> Hit search by inputting keyword.
    -> Search results displayed (multiple links) on the div named results.

    Currently the html page (search result) open in a new window when you click any of the result links.

    I am trying to get these links to open in the same DIV instead of a new window.

    Is this possible? If one cant load html content in DIV, is there some way to do it by using iFrames? (can I define an iFrame inside a div?

    Thanks for your help!!

  2. #2
    Join Date
    Mar 2009
    yes you can define an iframe inside a div

    <div><iframe name="myframe" src="about:blank"></iframe></div>

    then change target to frame for the links to be clicked

    a href="..." target="myframe">...</a>
    then you can style/position your div as required.

    hope it works, i did'nt try.

  3. #3
    Join Date
    Sep 2012
    Thanks ZABI,

    I have two questions though.

    1. Will I have to define the iFrame dimensions? Can it be set to expand with the size of the HTML search document?

    2. Since the links are 'called' to the div by way of search, the search display page is dynamic - the documents/html pages displayed changes based on search input.
    So I think I cannot set a 'a href =link, target.. as I wouldnt know what pages would be pulled by the result.

    May be I can explain the situation better below:

    Page A - has DIV for result display and Search Box.
    Folder /B: has all the articles saved as *.HTML pages

    Enter search keyword, matching *.HTML pages from Folder B are displayed on the DIV as URLs.
    This varies based on search keyword.

    Now I am trying to click one of these URLs to open in the same DIV.

    Using the method you mentioned, where should I place the a href = target..myframe> code?

    Thanks for your help!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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