Include one html file in another

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spartanicus

    Include one html file in another

    For a non essential enhancement of one of my pages I'd like to include a
    remote html file via javascript (server side is not available to me).

    The "include" method that I'm familiar with:

    <script src="include.js " type="text/javascript"></script>

    with include.js containing:

    document.write( "<table>")
    document.write( "<tr>")
    [...]

    wouldn't work because it's a remote file. Is there a way to include a
    remote file?

    --
    Spartanicus
  • Hywel

    #2
    Re: Include one html file in another

    In article <t6g0401pc0js6g 41iuo7itmgml85o 4nkkk@4ax.com>, me@privacy.net
    says...[color=blue]
    > For a non essential enhancement of one of my pages I'd like to include a
    > remote html file via javascript (server side is not available to me).
    >
    > The "include" method that I'm familiar with:
    >
    > <script src="include.js " type="text/javascript"></script>
    >
    > with include.js containing:
    >
    > document.write( "<table>")
    > document.write( "<tr>")
    > [...]
    >
    > wouldn't work because it's a remote file. Is there a way to include a
    > remote file?[/color]

    <script src="http://otherserver.com/include.js" type="text/javascript">
    </script>

    --
    Hywel I do not eat quiche


    Comment

    • Spartanicus

      #3
      Re: Include one html file in another

      Hywel <hyweljenkins@h otmail.com> wrote:
      [color=blue][color=green]
      >> For a non essential enhancement of one of my pages I'd like to include a
      >> remote html file via javascript (server side is not available to me).[/color]
      >
      ><script src="http://otherserver.com/include.js" type="text/javascript">
      ></script>[/color]

      HTML file

      --
      Spartanicus

      Comment

      • Hywel

        #4
        Re: Include one html file in another

        In article <40r0401gi9efh9 31cg2e7ggcggfc6 ss0bu@4ax.com>, me@privacy.net
        says...[color=blue]
        > Hywel <hyweljenkins@h otmail.com> wrote:
        >[color=green][color=darkred]
        > >> For a non essential enhancement of one of my pages I'd like to include a
        > >> remote html file via javascript (server side is not available to me).[/color]
        > >
        > ><script src="http://otherserver.com/include.js" type="text/javascript">
        > ></script>[/color]
        >
        > HTML file[/color]

        So why did you give an example of a JAVASCRIPT file that WRITES out
        HTML?

        <iframe> - bad.

        --
        Hywel I do not eat quiche


        Comment

        • Spartanicus

          #5
          Re: Include one html file in another

          Hywel <hyweljenkins@h otmail.com> wrote:
          [color=blue][color=green][color=darkred]
          >> >> For a non essential enhancement of one of my pages I'd like to include a
          >> >> remote html file via javascript (server side is not available to me).
          >> >
          >> ><script src="http://otherserver.com/include.js" type="text/javascript">
          >> ></script>[/color]
          >>
          >> HTML file[/color]
          >
          >So why did you give an example of a JAVASCRIPT file that WRITES out
          >HTML?[/color]

          To prevent being pointed out how to do that, it would have been useless
          as the question specifically pertained to including a non local file.
          [color=blue]
          ><iframe>[/color]

          Different thing completely, iframe/object opens a new viewport, included
          html is part of the original document.

          --
          Spartanicus

          Comment

          • Hywel

            #6
            Re: Include one html file in another

            In article <k56140piqvtn1m 6j8srork55jai47 7m1cd@4ax.com>, me@privacy.net
            says...[color=blue]
            > Hywel <hyweljenkins@h otmail.com> wrote:
            >[color=green][color=darkred]
            > >> >> For a non essential enhancement of one of my pages I'd like to include a
            > >> >> remote html file via javascript (server side is not available to me).
            > >> >
            > >> ><script src="http://otherserver.com/include.js" type="text/javascript">
            > >> ></script>
            > >>
            > >> HTML file[/color]
            > >
            > >So why did you give an example of a JAVASCRIPT file that WRITES out
            > >HTML?[/color]
            >
            > To prevent being pointed out how to do that, it would have been useless
            > as the question specifically pertained to including a non local file.
            >[color=green]
            > ><iframe>[/color]
            >
            > Different thing completely, iframe/object opens a new viewport, included
            > html is part of the original document.[/color]

            How about using JavaScript to get the remote page into an XML object,
            then use an almost empty XSL to display the HTML?

            --
            Hywel I do not eat quiche


            Comment

            • Spartanicus

              #7
              Re: Include one html file in another

              Hywel <hyweljenkins@h otmail.com> wrote:
              [color=blue][color=green]
              >> Different thing completely, iframe/object opens a new viewport, included
              >> html is part of the original document.[/color]
              >
              >How about using JavaScript to get the remote page into an XML object,
              >then use an almost empty XSL to display the HTML?[/color]

              Sounds intriguing, care to expand?

              --
              Spartanicus

              Comment

              Working...