469,327 Members | 1,295 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

javascript to html

Is there any tool available that can output html that corresponds to a page rendered by a
javascript website?

For example, here is a page rendered in javascript:

http://www.michigan-football.com/s/2005/fb05.htm

I'd like to have an html file that would look basically the same.

Thanks.
Sep 1 '05 #1
3 2507
Ken Massey wrote:
Is there any tool available that can output html that corresponds to a
page rendered by a javascript website?

For example, here is a page rendered in javascript:

http://www.michigan-football.com/s/2005/fb05.htm

I'd like to have an html file that would look basically the same.

Thanks.


1. Create a bookmark/favorite

2. Change the url to the following (please excuse wrapping, it should be
one continuous line):

javascript:'<code><ol><li>'+(document.documentElem ent ||
document.body).innerHTML.replace(/&/g,%22&amp;%22).replace(/</g,
%22&lt;%22).replace(/%20%20/g, %22&nbsp;%20%22).replace(/\n/g,
%22<li>%22)+'<\/ol><\/code>';

To see the page's HTML, select the bookmark. If you don't want the faux
line numbers, use:

javascript:'<code>'+(document.documentElement ||
document.body).innerHTML.replace(/&/g,%22&amp;%22).replace(/</g,
%22&lt;%22).replace(/%20%20/g, %22&nbsp;%20%22).replace(/\n/g,
%22<br>%22)+'<\/code>';

--
Rob
Sep 1 '05 #2
Thanks. That's a neat trick. Any ideas how to do it without a browser, e.g. via wget/curl and
a standalone interpreter like spidermonkey's js ?

RobG wrote:
Ken Massey wrote:
Is there any tool available that can output html that corresponds to a
page rendered by a javascript website?

For example, here is a page rendered in javascript:

http://www.michigan-football.com/s/2005/fb05.htm

I'd like to have an html file that would look basically the same.

Thanks.

1. Create a bookmark/favorite

2. Change the url to the following (please excuse wrapping, it should be
one continuous line):

javascript:'<code><ol><li>'+(document.documentElem ent ||
document.body).innerHTML.replace(/&/g,%22&amp;%22).replace(/</g,
%22&lt;%22).replace(/%20%20/g, %22&nbsp;%20%22).replace(/\n/g,
%22<li>%22)+'<\/ol><\/code>';

To see the page's HTML, select the bookmark. If you don't want the faux
line numbers, use:

javascript:'<code>'+(document.documentElement ||
document.body).innerHTML.replace(/&/g,%22&amp;%22).replace(/</g,
%22&lt;%22).replace(/%20%20/g, %22&nbsp;%20%22).replace(/\n/g,
%22<br>%22)+'<\/code>';

Sep 1 '05 #3
Ken Massey <km*****@masseyratings.com> writes:
Is there any tool available that can output html that corresponds to a
page rendered by a javascript website?


Try entering the following in the address bar:

javascript:document.body.innerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br>")

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Sep 1 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.