Mar 7, 2001 #1 jllinko MIS Mar 7, 2001 5 US Is it possible to access the html source code of a window via javascript. For example alert(window.xxxx) where the alert box show the same data as right clicking on the window and viewing the source.
Is it possible to access the html source code of a window via javascript. For example alert(window.xxxx) where the alert box show the same data as right clicking on the window and viewing the source.
Mar 7, 2001 #2 luciddream Programmer Nov 8, 2000 712 US this works in IE 5+ alert(document.documentElement.outerHTML); luciddream@subdimension.com Upvote 0 Downvote
Mar 7, 2001 Thread starter #3 jllinko MIS Mar 7, 2001 5 US Thnaks for the speedy reply, but unfortunatly, our company uses NS4.x only. Anyone have a NS soultion? Link Upvote 0 Downvote
Thnaks for the speedy reply, but unfortunatly, our company uses NS4.x only. Anyone have a NS soultion? Link
Mar 7, 2001 #4 jaredn Programmer Sep 1, 1999 1,506 US this should work in IE5: document.getElementsByTagName("HTML"[0].outerHTML; and something like the following should work in NS6(except you'll be missing the HTML tags): docoment.documentElement.innerHTML jaredn@eae.net - http://webfx.eae.net Upvote 0 Downvote
this should work in IE5: document.getElementsByTagName("HTML"[0].outerHTML; and something like the following should work in NS6(except you'll be missing the HTML tags): docoment.documentElement.innerHTML jaredn@eae.net - http://webfx.eae.net
Mar 7, 2001 #5 luciddream Programmer Nov 8, 2000 712 US wow, that is bad... you should try to convince them to atleast upgrade... if you were using NS6 you could use: alert(document.documentElement.innerHTML) and it would give you everything except the <html> tags. luciddream@subdimension.com Upvote 0 Downvote
wow, that is bad... you should try to convince them to atleast upgrade... if you were using NS6 you could use: alert(document.documentElement.innerHTML) and it would give you everything except the <html> tags. luciddream@subdimension.com
Mar 7, 2001 #6 jaredn Programmer Sep 1, 1999 1,506 US oh, didn't see your post, and no, you won't be able to get the source w/o storing it in a variable yourself. jaredn@eae.net - http://webfx.eae.net Upvote 0 Downvote
oh, didn't see your post, and no, you won't be able to get the source w/o storing it in a variable yourself. jaredn@eae.net - http://webfx.eae.net
Mar 7, 2001 Thread starter #7 jllinko MIS Mar 7, 2001 5 US Man... Thanks for all the replies. First time on this board, I'm impressed. Link Upvote 0 Downvote