tag:blogger.com,1999:blog-34454975.post594400277234953628..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: noscript problems? Just fixed ;-)Andrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-34454975.post-78858864216797837532008-04-26T21:09:00.000+02:002008-04-26T21:09:00.000+02:00any ideas on how to implement this if the page you...any ideas on how to implement this if the page you're putting it on is already php? i feel it should be easier... but i'm not able to make it work at all.mr_coffeehttps://www.blogger.com/profile/08325146323847460297noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-87797649104013065782007-09-22T09:44:00.000+02:002007-09-22T09:44:00.000+02:00I agree about legacy support Mike, however I don't...I agree about legacy support Mike, however I don't know Web 2.0 libraries compatible with IE4 or NN4 so I suppose these old (too much old) browsers should be filtered and managed as not compatible browsers.<BR/><BR/>At the same time, DOM usage is quite hilarious because the last piece of code breaks every kind of standard, modifying the page flow (document.write('<link hide="')).<BR/><BR/>The perfect solution, in my opinion, should use only DOM to be XHTML 2.0 <I>Strict</I> compatible but I suppose that new standards will not be available soon and that if we choose to use an external JS file the page will be validated automatically in every case.<BR/><BR/>Finally, if XHTML 2.0 (probably HTML 5 too) doesn't support document.write inside head tag, I think that there's no reason to use DOM while when XHTML 2.0 will be available We could use new <STRONG>handler</STRONG> to respect standards.<BR/><BR/>This is my definitive opinion:<BR/>Today We could just use this technique inside an external JS file:<BR/><BR/>document.write('<link ... /><link hide="');<BR/><BR/>Tomorrow We'll use another one respecting better W3 standards using handler.<BR/><BR/>Have a great weekend You too, best regards.Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-49936068678822415322007-09-22T01:06:00.000+02:002007-09-22T01:06:00.000+02:00Cool Andrea! Glad we were able to work out a solut...Cool Andrea! Glad we were able to work out a solution together; it was fun :-)<BR/><BR/>One note, your final solution does well to use DOM manipulation methods, but relying only on those breaks the IE 4 and NN 4 cross-browser support that my document.write solution gave.<BR/><BR/>Although it would be more code, maybe the final solution can use DOM feature detection to determine at runtime which technique to use i.e.:<BR/><BR/>if(typeof document.createElement != "undefined")<BR/> // use DOM manipulation technique<BR/>else<BR/> // use document.write technique<BR/><BR/>Just a thought. I figure since we now know how to support this technique for modern <B><I>and</I></B> legacy browsers why not build it into the final solution.<BR/><BR/>Have a great weekend and stay imaginative :-)<BR/><BR/>P.S. Thanks for the credit!{Michael : iSkitz}https://www.blogger.com/profile/07632896592054092882noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-38194683910297259262007-09-21T16:57:00.000+02:002007-09-21T16:57:00.000+02:00Hi Mike ... coll again!Your link hide=" is the pro...Hi Mike ... coll again!<BR/><BR/>Your link hide=" is the problem killer.<BR/><BR/>I've just uploaded 3 pages that uses the same unobtrusive way to allow only DOM with createElement and getElementsByTagName compatible browsers.<BR/><BR/><A HREF="http://www.3site.eu/examples/css4js/test.xhtml1.html" REL="nofollow">xhtml 1.0 Strict</A><BR/><A HREF="http://www.3site.eu/examples/css4js/test.html4.html" REL="nofollow">html 4.01 Strict</A><BR/><A HREF="http://www.3site.eu/examples/css4js/test.quirks.html" REL="nofollow">quirks</A><BR/><BR/>Could We tell now We found (You before me) the real solution for this stupid problem? :D<BR/><BR/>P.S. Yes, collaboration is wonderful ;-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-27978085060549651342007-09-21T14:40:00.000+02:002007-09-21T14:40:00.000+02:00Hmmmm,I like your CDATA modification. The XHTML 1....Hmmmm,<BR/>I like your CDATA modification. The XHTML 1.0 Strict thing bothered me so I just had to find a way around it :-)<BR/><BR/>Check these out:<BR/><A HREF="http://ajile.sourceforge.net/tests/dynamic.css/xhtml.1.0.htm" REL="nofollow">XHTML 1.0 Solution</A><BR/><A HREF="http://ajile.sourceforge.net/tests/dynamic.css/html.4.01.htm" REL="nofollow">HTML 4.01 Solution</A><BR/><A HREF="http://ajile.sourceforge.net/tests/dynamic.css/quirks.mode.htm" REL="nofollow">Quirks Mode Solution</A> (no validation)<BR/><BR/>Cross-browser <B><I>and</I></B> W3C valid!<BR/><BR/>Collaboration, wonderful isn't it? ;-){Michael : iSkitz}https://www.blogger.com/profile/07632896592054092882noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-84208961936023198932007-09-21T03:42:00.000+02:002007-09-21T03:42:00.000+02:00damn Mike ... Your solution works perfectly with F...damn Mike ... Your solution works perfectly with FF and IE but doesn't work with Opera or Safari:<BR/><A HREF="http://www.3site.eu/examples/css4js/index.new.html" REL="nofollow">example</A><BR/><BR/>I did a lot of different tests: compatibility VS W3 validation ... anything to do :-(<BR/><BR/>However, above link uses CDATA instead of <!-- and it's compatible with every kind of DTD ... but, as I said, it doesn't work correctly with two major browsers ... what a problem!Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-43178872287350154482007-09-21T02:33:00.000+02:002007-09-21T02:33:00.000+02:00damn cool Mike!I didn't test your idea but it seem...damn cool Mike!<BR/>I didn't test your idea but it seems to be real good.<BR/><BR/>Just a note: xhtml 2.0 and probably HTML 5.0 too doesn't accept usage of document.write inside head to write html content.<BR/><BR/>However, your solution should be runned outside page and with DOM it should be easyly replaced (I mean link tag).<BR/><BR/>At this point the only question is if document.write("<"+"!--//"); after link inclusion, using DOM, will be accepted by XHTML 2.0 and future (z)HTML implemnetations but now, I can only say <B>thank you</B>!Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-68065263074751342892007-09-21T01:57:00.000+02:002007-09-21T01:57:00.000+02:00"If a script tag is before a link, it can't replac...<I>"If a script tag is before a link, it can't replace next DOM element (the link) because it will not be available while if a script tag is after link, its content has just been downloaded ... two files for JS compatible browsers if You replace, add or modify dynamically used CSS."</I><BR/><BR/>Right you are, a glaring oversight on my part, good catch ;-)<BR/><BR/>I still feel a lightweight client-side solution is possible and have tested just such a solution. If I may:<BR/><BR/>1. Place the following code in a script tag in the head section of your HTML page just before your link tag that loads your legacy CSS:<BR/><BR/>document.write('<link ... href="advanced.css" \/>');<BR/>document.write("<"+"!-- ");<BR/><BR/>2. After your legacy link, place an empty comment as follows:<BR/><BR/><link ... href="basic.css" /><!-- --> <BR/><BR/>Voila! Cross-browser client-side solution. In case you don't immediately see why it works, it's because the open comment written by the Javascript comments out the legacy CSS link that follows.<BR/><BR/>This works with modern browsers, IE 4 and NN 4, pretty cross-browser no?<BR/><BR/>Okay so there *is* one catch, if your doctype is xhtml 1.0 strict, the comment doesn't get written as a comment, but as &lt;--. Not sure why, but it does, maybe you can say why???<BR/><BR/>If you can figure that out, my proposal would be a perfect client-side solution don't you think?{Michael : iSkitz}https://www.blogger.com/profile/07632896592054092882noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-13171511568939262382007-09-19T21:01:00.000+02:002007-09-19T21:01:00.000+02:00arantius, what You say is absolutely against best,...arantius, what You say is absolutely against best, unobtrusive, accessible Web practices.<BR/><BR/>Gmail is a service, not a web-site, this mean that Gmail doesn't require that search engines read page content.<BR/><BR/>In your way, each visited page will use a redirect and every content will be unavailable for search engines.<BR/><BR/>It's quite clear, You didn't understand why I propose this solution and how many problem could solve for both bandwidth usage and surfers.<BR/><BR/>RegardsAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-67228255384328363412007-09-19T20:08:00.000+02:002007-09-19T20:08:00.000+02:00I think this is what GMail does, I prefer it to yo...I think this is what GMail does, I prefer it to your solution above.<BR/><BR/>Use a meta tag to refresh in (i.e.) 1 second, but a script to location.replace() before that. If the script runs, the user ends up at the full script-ified version of the site. If it doesn't, the meta will send the user to a page explaining the need for javascript.arantiushttps://www.blogger.com/profile/14641102142645956202noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-68177663689119568972007-09-19T13:59:00.000+02:002007-09-19T13:59:00.000+02:00"The manipulator.js could manipulate the page's DO..."<I>The manipulator.js could manipulate the page's DOM by replacing the existing link tag with the special/fancy web 2.0 one.</I>"<BR/><BR/>Mike, You probably didn't think about syncronous download.<BR/><BR/>If a script tag is before a link, it can't replace next DOM element (the link) because it will not be available while if a script tag is after link, its content has just been downloaded ... two files for JS compatible browsers if You replace, add or modify dynamically used CSS.<BR/><BR/>My goal is to make page as faster as possible to download, truly separing JS enabled browsers from other and let them download only necesary files without replacements or other kind of fake solutions.Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-52466052151380988012007-09-19T01:52:00.000+02:002007-09-19T01:52:00.000+02:00Maybe I'm missing something here, but why not simp...Maybe I'm missing something here, but why not simply do this:<BR/><BR/>1. <script ... src="manipulator.js"></script><BR/><BR/>2. <link ... href="basicstyle.css"/><BR/><BR/>The manipulator.js could manipulate the page's DOM by replacing the existing link tag with the special/fancy web 2.0 one. <BR/><BR/>If the <script> tag is processed before the <link> then replacing is guaranteed, if the <script> isn't processed before the <link> tag then the script can still insert a style sheet with settings that override those in the basicstyle.css.<BR/><BR/>I see no need for server-side involvement or cookies here...{Michael : iSkitz}https://www.blogger.com/profile/07632896592054092882noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-37131966052113597192007-09-18T19:05:00.000+02:002007-09-18T19:05:00.000+02:00any different way to both respect standards and us...<I>any different way to both respect standards and users</I><BR/>obviously, I mean using less bandwidth for everyone and make this "trick" accessible for cokkies disabled browsers too.Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-34974177991884284602007-09-18T19:03:00.000+02:002007-09-18T19:03:00.000+02:00Federico, session is a cookie ... but if browser h...Federico, session is a cookie ... but if browser has cookies disabled, session id (SID) is automatically injected as query string for each request.<BR/><BR/>In this case the link href, when cookies are disabled, become automatically myPage.php?phpsessid=AF5233AF...<BR/><BR/>There's no way to change dinamically link href ... that's why I used server session.<BR/><BR/>Finally, I suppose a little session file with just one boolean value (4 chars ... b:0; or b:1;) is not a problem for a server and think that a lot of sites uses always sessions, so I hope W3 will remove noscript parser error if present inside head tag but until them I can't find any different way to both respect standards and users!Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-9318878603944414162007-09-18T17:40:00.000+02:002007-09-18T17:40:00.000+02:00Hi Andrea, cool stuff, I have a question: can't yo...Hi Andrea, cool stuff, I have a question: can't you just set a cookie on the client instead of creating a new session that is overkill for the server?Unknownhttps://www.blogger.com/profile/06459983499030941629noreply@blogger.com