Forum Moderators: not2easy

Message Too Old, No Replies

Hiding from NON CSS browsers

hiding content from non css browsers

         

ASPwiz

6:39 am on Jun 30, 2004 (gmt 0)

10+ Year Member



Hi...

I want to hide some content from non css browser.

Most people want to do this the other way round, and hide stuff in CSS browsers, however, i am not doing this.

I have some help text that does not apply to non css browsers (eg. lynx) and so I want to hide it.... is this possible?

DrDoc

1:22 pm on Jun 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That means you need to revert to some form of server side scripting (Perl/PHP/ASP), and check the user agent. Just be careful! Many "sniffers" out there are far from reliable.

Another approach, though not as reliable either, would be to use JavaScript to print the content.

ASPwiz

1:32 pm on Jun 30, 2004 (gmt 0)

10+ Year Member



Both of those, are totally out.

the first would really on a COMPLETE and up to date database of user-agents....

the second is out completely, coz I'm going for a 100% javascript free site.... and this is jsut a no-no.

Surely the must be a way to hack something in that the non-css would ignore without resorting to jscript.

Besides, some early browsers, whilst being non css still do javascript.

Javascript is out as a solution for me.

DrDoc

2:09 pm on Jun 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Then I'm afraid you're out of luck...
Your best bet is to gather up an array of old user agent strings, then NOT display the content for these. If that's not a feasible solution, you have no choice but to live with it :)

jetboy_70

2:25 pm on Jun 30, 2004 (gmt 0)

10+ Year Member



Or think outside the box ...

<p style="display:none;">Please ignore the following if you are using a text browser:</p>

<p>Help text for CSS browsers</p>

Not pretty, but more accessible than nothing at all.

SuzyUK

2:42 pm on Jun 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Generated Content would be an answer but you know what IE thinks of that ;)

I checked out IE7 [dean.edwards.name] and this would be worth keeping an eye on as he says

My next priority is support for generated content.

Suzy

ASPwiz

3:24 pm on Jun 30, 2004 (gmt 0)

10+ Year Member



Hi....

Yes, I am already using IE7, so I guess I'll wait for dean's next update and use #help:before {content:blah}

Cheers all.

Rob

jetboy_70

3:37 pm on Jun 30, 2004 (gmt 0)

10+ Year Member



I'm going for a 100% javascript free site

I am already using IE7

Am I missing something here? These seem like conflicting statements.

ASPwiz

4:14 pm on Jun 30, 2004 (gmt 0)

10+ Year Member



The IE7 is only invoked (server side check) for ie5+

that is the only time IE7 is invoked...

and yes.... that comment i made above was a little innacurate :lol:

I do feel that this particular javascript (for IE only) is a nessessity.