[WSG] Print stylesheet switcher
Hi all, I've got a page that has a print stylesheet, and two elements of important (i.e. the things you'd want to print) content. One is a list of items, whilst the other element is a kind of "More information" area (linked by XMLHttpRequest if JS is enabled). In the "More information" bit, there's meant to be a "print details" button. It was originally going to exist in an iframe, but I wasn't too keen on that idea because it's generally disruptive in ways that AJAX (or, in lieu of that, plain HTML with effectively-utilised anchors) is not. So now I'm trying to print just the contents of that DIV when a user clicks the print icon (using print(), or window.print(), or whatever), but if the user attempts to print the page normally -- that is, go File->Print -- the listing would print, and the details of the currently selected item would not. To achieve this I plan on using two stylesheets: the default print stylesheet will discard the "More Information" div, whilst the More Information div's print button will call (hopefully) a JavaScript function that will set the print style to one in which the only item displayed is that DIV (well, and a few other bits like H1, but it doesn't matter: the point is it's another stylesheet), and THEN print(). Normal JavaScript (media=screen) switchers are pretty common, but does anyone have suggestions as to how best to go about this one? n.b. I can't just switch the stylesheet when the "More Information" field is loaded, because even when it is people may still want to print the standard listing, which remains visible at all times. The switching MUST apply just to the print styles, and MUST occur only when the print 'button' is clicked (the button will be inserted into the markup dynamically, so it remains clean for non-JS users). Kind regards, Josh Street ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
RE: [WSG] ufo flash adding padding/
"This might be something to do with the Flash items on the lower right, because they flickered around where the nav items were before positioning themselves properly:" thanks, i hadnt noticed that, hopefully when i embed those using the ufo system it will solve the flickering. -best kvnmcwebn ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] ufo flash adding padding/
Good to hear you solved it, but one other thing. I observed in Firefox 1.0.x/Linux that the borders on your left navigation items appear/disappear at certain zoom settings. This might be something to do with the Flash items on the lower right, because they flickered around where the nav items were before positioning themselves properly: However, upon sizing up/down, the problem resolved itself. Almost certainly Firefox, not you, but thought I'd say something anyway... Josh On 1/18/06, kvnmcwebn <[EMAIL PROTECTED]> wrote: > hello all, > Im using the ufo flash embed method.Something is adding about 30px of > padding or height to the top of my swf. If i resize the dimensions in the > html it takes from the top and bottom of the movie so that some of the swf > is cut off at the bottom. > heres the page > > 209.200.102.116 > > > any suggestion would be apreciated. > thanks > knvmcwebn ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] content type etc
Thanks very much Lachlan, I'll start to study the all matter as soon as I'll get home. A couple of hours I guess. I really need to work this out once and for all. Best Regards. Paolo Dodet -- Real knowledge is based on experience. All that is left is pure vanity.
Re: [WSG] content type etc
Paolo Dodet wrote: That is. If you access my personal site using IE you will notice that I use a meta tag to declare the mime-type, and in the case of IE it would be text/html, whereas if you access using any other browser the page will be served as XML, using a xml declaration, without any meta-tag to declare the mime-type. http://www.noblocodenotas.com/ That makes no sense whatsoever! You never need to use the meta element for content served over HTTP for *any* browser. IE supports the HTTP headers just fine: Besides, your server is not sending the correct HTTP response headers to any browser, even though it is stripping the meta element and adding the xml declaration for those that support it. These are the response headers sent to Firefox regardless of the value of the Accept header. HTTP/1.x 200 OK Date: Tue, 17 Jan 2006 21:49:22 GMT Server: Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Keep-Alive: timeout=1, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html Regardless of whether the Accept header contained application/xhtml+xml or only text/html, the meta element was stripped and the XML declaration was added, yet the Content-Type of text/html remained the same. These response headers were sent when the browser identified itself as IE (including Firefox when I modified the User-Agent header to match IE6): HTTP/1.1 200 OK Date: Tue, 17 Jan 2006 21:44:21 GMT Server: Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Transfer-Encoding: chunked Content-Type: text/html Regardless of the Accept header again, the meta was element was included, the XML declation was not. This proves that not only are you failing to set the HTTP headers correctly, but you're changing the document based on the perceived browser support judged only by the the User-Agent request header. In other words, you're browser sniffing and that is never the right way to do things. If you wish to do content negotiation, please do so properly. This article [1] posted here earlier explains the correct way to set the headers and detect based on the Accept header. For HTML, the Content-Type response header should contain this: Content-Type: text/html; charset=ISO-8859-1 Don't include the XML declaration. (Note: I recommend you switch to using UTF-8 instead, but it requires that your files actually be saved as UTF-8, not just changing the value in this header) For XHTML, use this: Content-Type: application/xhtml+xml Include the XML declaration to declare the encoding. *DO NOT* use the meta element for any browser at all, in fact don't even include it in your document under any circumstances when serving over HTTP. (It can be useful for testing on the local file system, but useless for anything beyond that). [1] http://www.thatstandardsguy.co.uk/2006/01/16/content-negotiation/ -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
RE: [WSG] ufo flash adding padding/
oops problem solved, my fault.. - hello all, Im using the ufo flash embed method.Something is adding about 30px of padding or height to the top of my swf. If i resize the dimensions in the html it takes from the top and bottom of the movie so that some of the swf is cut off at the bottom. heres the page 209.200.102.116 any suggestion would be apreciated. thanks knvmcwebn ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ** ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
[WSG] ufo flash adding padding/
hello all, Im using the ufo flash embed method.Something is adding about 30px of padding or height to the top of my swf. If i resize the dimensions in the html it takes from the top and bottom of the movie so that some of the swf is cut off at the bottom. heres the page 209.200.102.116 any suggestion would be apreciated. thanks knvmcwebn ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] content type etc
Hello! Paolo Dodet skrev: That is. If you access my personal site using IE you will notice that I use a meta tag to declare the mime-type, and in the case of IE it would be text/html, whereas if you access using any other browser the page will be served as XML, using a xml declaration, without any meta-tag to declare the mime-type. When using the meta tag to declare content-type, it is best practice to put it as early in the html as possible. I always put it immediately after the head opening tag. The logic behind this is that the browser should have to parse as little as possible before finding the content-type meta tag (as it sometimes has change the encoding of everything before the meta tag). This also shows why this information always should be sent with the http headers in the first place. /AndersN ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] Plesk (hosting control panel system) and web standards support
On 1/12/06, James Ellis <[EMAIL PROTECTED]> wrote: > I'd check out a Plesk demo and look under the hood - probably the best > bet. Or just install it on a demo site and see what happens. > > One of the gripes I have is that 90+% of these off the shelf systems > hand you a frontend and a backend in one inseparable lot. It would be > great to have an application say "here's the data you requested from > the backend, present it yourself if you like"... Thanks James, that's what I'll do... I was just hoping someone else had been there before! I was horrified to find a java-based templating system underneath HSphere that allowed you to set the colours in the font tags and the backgrounds of table cells - a massively complex undertaking for what could be far more easily accomplished with a stylesheet. But enough ranting from me... -- Kay Smoljak http://kay.zombiecoder.com/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] content type etc
> Thanks a lot for the answer, Lachlan. > > The reason I asked you this is that I normally send two different > content-type according to the browser. > > That is. If you access my personal site using IE you will notice that I use > a meta tag to declare the mime-type, and in the case of IE it would be > text/html, whereas if you access using any other browser the page will be > served as XML, using a xml declaration, without any meta-tag to declare the > mime-type. > > Now, even though the all thing validates as XHTML1.0 Strict, I was > wondering whether that would be the correct practice. > > This the link to my personal page: > > www.noblocodenotas.com > > Best regards. > > Paolo Dodet Huston, we've got a problem! :D ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] content type etc
Sorry, I did a mistake! :) ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] content type etc
Thanks a lot for the answer, Lachlan. The reason I asked you this is that I normally send two different content-type according to the browser. That is. If you access my personal site using IE you will notice that I use a meta tag to declare the mime-type, and in the case of IE it would be text/html, whereas if you access using any other browser the page will be served as XML, using a xml declaration, without any meta-tag to declare the mime-type. Now, even though the all thing validates as XHTML1.0 Strict, I was wondering whether that would be the correct practice. This the link to my personal page: www.noblocodenotas.com Best regards. Paolo Dodet
Re: [WSG] Article: MIME and Content Negotiation
designer skrev: So I made a simplified version of my opening page (removed counters and other impedimenta) and removed the meta tags. All I got was Chinese and gobbledegook! So I uploaded it to: http://www.rhh.myzen.co.uk/rhh/gam/test.php I was stunned to find that it works a treat when uploaded! On my local machine I am using wampserver for testing. Any ideas as to why this should occur? Is it to do with utf-8? Use http://livehttpheaders.mozdev.org/ to check what http headers are really sent from the wampserver. /AndersN ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] Article: MIME and Content Negotiation
designer wrote: So I made a simplified version of my opening page (removed counters and other impedimenta) and removed the meta tags. All I got was Chinese and gobbledegook! So I uploaded it to: http://www.rhh.myzen.co.uk/rhh/gam/test.php Did it look anything like this? http://software.hixie.ch/utilities/cgi/content-type-proxy/content-type-proxy?uri=http%3A%2F%2Fwww.rhh.myzen.co.uk%2Frhh%2Fgam%2Ftest.php&type=text%2Fplain%3Bcharset%3DUTF-16 It could be that your testing server is sending UTF-16 (or some other incorrect encoding) for some strange reason. The easiest way to find out is by using Mozilla or Firefox, go to Tools>Page Info... and look at the MIME type and encoding information listed in the dialog. -- Lachlan Hunt http://lachy.id.au/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **
Re: [WSG] Article: MIME and Content Negotiation
Hi Lachlan, Philippe, and all, So I made a simplified version of my opening page (removed counters and other impedimenta) and removed the meta tags. All I got was Chinese and gobbledegook! So I uploaded it to: http://www.rhh.myzen.co.uk/rhh/gam/test.php I was stunned to find that it works a treat when uploaded! On my local machine I am using wampserver for testing. Any ideas as to why this should occur? Is it to do with utf-8? -- Best Regards, Bob McClelland Cornwall (UK) www.gwelanmor-internet.co.uk Lachlan Hunt wrote: Can you please make up a small sample document that clearly demonstrates this issue occurring and post a URI so that we may see it. ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help **