using Javascript to insert HTML from another HTML

G

Giovanni Azua

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
 
S

Sudrien

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top