08-06-2004, 23:23
|
#1
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
view page source
I'm trying to debug the Javascript for a web page generator. I have set up a test page here that looks completely different in IE, Opera and Firefox.
Does anyone know how I can view the 'document' that is generated by the Javascript (using document.write() commands) which the browser uses to render the page?
|
|
|
09-06-2004, 00:56
|
#2
|
|
Dr Pepper Addict
Cable Forum Admin
Join Date: Oct 2003
Location: Nottingham
Age: 63
Services: Zen & YouFibre FTTP, Sky Q TV, Sky Mobile, Flextel SIP
Posts: 31,312
|
Re: view page source
Well I just captured it using a traffic analyser - but it's a bit too long to post.
__________________
Baby, I was born this way.
|
|
|
09-06-2004, 08:59
|
#3
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
Re: view page source
'Scuse me, but I'm not sure that that will tell us anything. The only thing that will be sent over the net are the raw files test.htm, test.js and test.css etc. I typed these in so I know what they look like! What I actually want is the 'document' that is created by the Javascript running on the client side. This isn't a server side script - it's hosted on ntlworld!
I'm not sure if it's possible to do this but I thought someone might know.
|
|
|
09-06-2004, 09:18
|
#4
|
|
Inactive
Join Date: Jun 2003
Location: Swindon
Age: 54
Services: BT FTTP, Humax Foxsat HDR Freesat+
Posts: 810
|
Re: view page source
Is this what you mean?
This code is different than what I get when I just "View Source" from within IE, just get the "Sorry - you must enable Javascript to view this page" in IE.
http://homepage.ntlworld.com/mikeyb/altis.htm
|
|
|
09-06-2004, 09:38
|
#5
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
Re: view page source
Brilliant - that's it!
What's more that looks very much like what IE must be using when it goes all screwy.
How did you generate that MikeyB
|
|
|
09-06-2004, 09:48
|
#6
|
|
Dr Pepper Addict
Cable Forum Admin
Join Date: Oct 2003
Location: Nottingham
Age: 63
Services: Zen & YouFibre FTTP, Sky Q TV, Sky Mobile, Flextel SIP
Posts: 31,312
|
Re: view page source
Quote:
|
Originally Posted by altis
'Scuse me, but I'm not sure that that will tell us anything. The only thing that will be sent over the net are the raw files test.htm, test.js and test.css etc. I typed these in so I know what they look like!
|
ok, sorry.
__________________
Baby, I was born this way.
|
|
|
10-06-2004, 23:20
|
#7
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
Re: view page source
Thanks to MikeyB I'm on the right road. Results here:
http://homepage.ntlworld.com/altisuk...ewich/test.htm
(still got a bit of tidying to do but at least it works now)
I'd still like to know how you generated that listing though.
|
|
|
10-06-2004, 23:37
|
#8
|
|
Inactive
Join Date: Jan 2004
Location: Essex
Age: 43
Services: 80/20Mbps FTTC on Freeola
Posts: 871
|
Re: view page source
Looks like he just did a right click and view source maybe? This is what happens in konqueror:
<html>
<head>
<title>A Test Page</title>
<meta http-equiv="content-script-type" CONTENT="text/javascript">
<script src="test.js"></script>
</head>
<body>
<script>
page = new Array(
'c','a header',
'd','Saturday, 15th June 2003',
'l','3359','Adlington Morris Men',
'l','3365',"Martha Rhoden's Tuppeny Dish",
'p','3370','Shropshire Bedlams',
'l','3375','Stockport Morris Men',
'l','3377','Witchmen',
'p','3381','Ringheye Morris - with added ventilation!',
'l','3382','Waterson:Carthy',
'l','3386','Oyster Band',
's','4154','1285','584','Some yaks!',
'c','a footer')
render(page)
</script>
<noscript>Sorry - you must enable Javascript to view this page</noscript>
</body>
</html>
|
|
|
11-06-2004, 08:32
|
#9
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
Re: view page source
Exactly the same happens in IE, Opera and Firefox. That is the raw contents of the HTML file. Most of it is just a Javascript array definition (this will be different on other pages).
What I am after is the HTML code that is generated by the line 'render(page)'. I can obviously view the results but I cannot work out how to view the text version that MikeyB has produced.
|
|
|
10-07-2004, 14:11
|
#10
|
|
Inactive
Join Date: Jun 2003
Location: Swindon
Age: 54
Services: BT FTTP, Humax Foxsat HDR Freesat+
Posts: 810
|
Re: view page source
Oops. Sorry, missed this thread.......
Anyway, how I got the gerenrated source code was using a tool called Web Sleuth from http://sandsprite.com/Sleuth/
It's a set of little tools that adds itself into IE, some on the toolbar, some on the right-click menu.
One of the options on the right-click menu is "Edit Source" and it shows you the all source as run/compiled whatever!
|
|
|
11-07-2004, 21:19
|
#11
|
|
Inactive
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
|
Re: view page source
Brilliant, thanks MikeyB
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 19:46.
|