browser detection in django

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

browser detection in django

piksel
I have a webpage which look nice under one browser and terrible in
another. I'd like to write separate css file for second browser. I'd
like to know if there is possibility to check in template under which
browser I am? I mean something like this:

{% if browser="nice_browser" %}
     load css file for nice_browser
{% else %}
     load css for other browser
{% endif %}

I know how to detect browser under javascript but to give this
information for django? Is it possible to post some information from
JS to django?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: browser detection in django

Simon Bächler-2
Hi

Do you know modernizr? http://www.modernizr.com/

It's a small Java script that detects browser capabilities and adds
them to the 'body' tag.

Also check out http://html5boilerplate.com/. There is a browser reset
css that tries to get all browsers to a common base.

Regards
Simon


On 16 Nov., 12:31, azonips <[hidden email]> wrote:

> I have a webpage which look nice under one browser and terrible in
> another. I'd like to write separate css file for second browser. I'd
> like to know if there is possibility to check in template under which
> browser I am? I mean something like this:
>
> {% if browser="nice_browser" %}
>      load css file for nice_browser
> {% else %}
>      load css for other browser
> {% endif %}
>
> I know how to detect browser under javascript but to give this
> information for django? Is it possible to post some information from
> JS to django?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: browser detection in django

DrBloodmoney
Well if it is IE then you can do conditional commenting for IE to detect itself:

<!-- [ if lt IE9 ] -->
css
<!-- [endif] -->

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.