using Javascript to insert HTML from another HTML

Discussion in 'Javascript' started by Giovanni Azua, Jul 15, 2007.

  1. Hi all,

    I am building a site using maven and within my reports I get generated
    automatically the java code
    in HTML format see e.g.

    http://perfectjpattern.sourceforge.net/xref/perfectjpattern/core/behavioral/observer/Subject.html

    I would like to include in the documentation e.g. Observer pattern
    documentation snippets of
    example code taken from these xref generated reports. I would need (if
    exists) a javascript
    function that takes as argument (url, start, end) of an existing HTML page
    and create sort of
    a small frame that will display the code snippet. Something very similar to
    how Oreilly Safari
    displays code snippets but instead of hardcoding it, have such hypothetical
    javascript function
    copying it from the xref page.

    Any ideas?

    Regards,
    Giovanni
    Giovanni Azua, Jul 15, 2007
    #1
    1. Advertising

  2. Giovanni Azua

    Sudrien Guest

    On Jul 15, 5:45 pm, "Giovanni Azua" <> wrote:
    > Hi all,
    >
    > I am building a site using maven and within my reports I get generated
    > automatically the java code
    > in HTML format see e.g.
    >
    > http://perfectjpattern.sourceforge.net/xref/perfectjpattern/core/beha...
    >
    > I would like to include in the documentation e.g. Observer pattern
    > documentation snippets of
    > example code taken from these xref generated reports. I would need (if
    > exists) a javascript
    > function that takes as argument (url, start, end) of an existing HTML page
    > and create sort of
    > a small frame that will display the code snippet. Something very similar to
    > how Oreilly Safari
    > displays code snippets but instead of hardcoding it, have such hypothetical
    > javascript function
    > copying it from the xref page.
    >
    > Any ideas?
    >
    > Regards,
    > Giovanni


    Not by line number - but if you were to have the ID of a section, you
    could retrieve the contents of that section and use some regular
    expressions on innerHTML for viewing it. There wouldn't /have/ to be
    an ID's container (just a container of some sort), but that would make
    it much easier code to write.

    -Sud.
    Sudrien, Jul 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dhanasankar S via DotNetMonster.com

    How to read the BODY of HTML file from another HTML file using javascript?

    Dhanasankar S via DotNetMonster.com, Feb 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    461
    =?Utf-8?B?dHBlcnJp?=
    Feb 28, 2005
  2. Replies:
    3
    Views:
    12,157
    Beauregard T. Shagnasty
    Jan 10, 2006
  3. Replies:
    1
    Views:
    1,779
    Albert Hopkins
    Dec 6, 2008
  4. Feege
    Replies:
    0
    Views:
    448
    Feege
    Dec 20, 2005
  5. Sergio del Amo
    Replies:
    4
    Views:
    233
Loading...

Share This Page