Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2004, 03:58 PM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default SSI funnies

Hi All

Can I ask you to bear with me on this - I've been developing webs now for 5 years and it would appear I've missed something here. This is how I design sites:-

1. Photshop master
2. Slice Photoshop and create an htm file of the interface
3. cut up htm file into SSI's and recreate with ASP. This is my site page template.

I've used this method for years but this time it won't work and I can't see why.

The problem is the page should fill the screen but doesn't. The tables are set to 100% height & width.

One more thing - Server win2003 and tested on IE6 & N7 all pages display OK in IE5.

Following are url's and a description.

This is the page causing the problem
http://www.ecraft.co.uk/Pages/Site/Default.asp

This page is htm with no SSI's - displays OK
http://www.ecraft.co.uk/Pages/Site/Default.htm

This page uses SSI's but has the shtm extension so used a different interpreter. Displays OK
http://www.ecraft.co.uk/Pages/Site/Default.shtm

Sorry fo banging on a bit but I wanted to explain.

Does anyone have any Ideas
Regards
Andy G
 
Old January 7th, 2004, 04:38 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The only thing that I see that's out of the ordinary is that your asp version is spitting this out:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

Otherwise it looks fine and is identical to the htm version that works. I can't imagine why that would bother the browser renderer.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 7th, 2004, 05:06 PM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Peter

I've fixed it.

The following 2 line are automatically added by Dreamweaver 2004 -

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Removing them makes the page fill the screen.

Does anyone know why this is.

Andy G
 
Old January 7th, 2004, 05:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:Originally posted by planoie
 The only thing that I see that's out of the ordinary is that your asp version is spitting this out:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
Which somehow seems to indicate that the ASP pages are *not* processed by the ASP run-time.

Is the server setup to run ASP correctly?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 7th, 2004, 05:41 PM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar

The pages must be processed as the includes work as does the data access side of the site.

I commited the cardinal sin of making 2 changes in one pass.

The line which is causing the error is this one -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

It must be some 'later' browser config. IE 5 is OK with the above line but Ie6 & N7 are not. I'll look around www.w3.org and see what I can get.

Whats nice is that I've not had a 100 replies saying you idiot - call yourself a developer and the answer was easy (OK it was easy) . Maybe there is something here we all need to learn.

Andy G
 
Old January 7th, 2004, 06:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

It's because of something lovingly called doctype switching that has been going on for quite some time now. Basically modern browsers have two rendering modes (Except Mozilla that have three). Standards (AKA Strict) Mode and Quirks Mode. In Quirks Mode they emulate older versions of themselves except Opera that emulates IE. *sigh*

Your doctype puts IE6 in Standards Mode. I think removing it is a bad choice, at least without knowing why. Better make your markup work in modern browsers first and hack for old ones second.

I didn't think this was "it" first because as I understood it you had a line of unparsed ASP before the doctype. That would put IE6 in Quirks Mode but I guess I misunderstood you.

Some reading to start5 with:
http://gutfeldt.ch/matthias/articles/doctypeswitch.html
http://msdn.microsoft.com/library/de...hancements.asp
http://mozilla.org/docs/web-developer/quirks/
http://www.opera.com/docs/specs/doctype/

(o<
//\ =^..^=
 
Old January 7th, 2004, 06:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Where has that edit button gone?

I realize that was a little unclear. What triggers these rendering modes is your choice of doctype or lack thereof. To really simplify, a complete doctype with a URL gives you Standards Mode and a shortform without a URL or no doctype at all give you Quirks Mode.


(o<
//\ =^..^=
 
Old January 8th, 2004, 04:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yep, and in the standards compliant mode, IE will not obey to the height="100%" attribute on a table tag, as this is not defined in the standards (http://www.w3.org/TR/html4/index/attributes.html)

One way around this is to use CSS. You could set a width and height of the <body> and <table> tags to 100% in a CSS file / definition. This works in IE and Opera *with* the doctype:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  </head>
<body style="height:100%; margin: 0px;">
<table "width=100%" style="height: 100%; border: 1px solid black;" cellspacing="0" cellpadding="0">
<tr>
  <td style="vertical-align: middle; text-align: center">I'm in the middle</td>
</tr>
</table>
</body>
</html>
Although Netscape doesn't like the doctype in this example.....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 1st, 2004, 08:55 PM
Authorized User
 
Join Date: Jan 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does this mean when coding in ASP, we should still declare a doctype like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

I never have before, but I am trying to have all of my pages comply with w3c standards.

-Darren


 
Old March 1st, 2004, 10:51 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This doctype declaration is simply an HTML document type declaration. It tells the browser about the document, what standards it *should* conform to and how to display the elements of the page based on that standard. It really has nothing to do with ASP, just the resulting HTML.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET and SSI kwilliams ASP.NET 1.x and 2.0 Application Design 1 March 21st, 2006 11:47 PM
XSL & SSI - Is it possible? kwilliams XSLT 1 August 9th, 2005 09:48 AM
SSI includes in XSLT nrane26 XSLT 1 January 7th, 2005 04:51 AM
Tomcat 5 with SSI ... HELP! HELP! HELP! soxar HTML Code Clinic 1 June 13th, 2004 12:52 AM
Response.Write an SSI hcweb Classic ASP Basics 2 November 2nd, 2003 05:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.