Results 1 to 8 of 8

Thread: Need to detect the browser and resolution and...

  1. #1
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need to detect the browser and resolution and...

    I wanted to do something like the following:

    START
    browser = detectbrowser();
    resolution = detectresolution();

    if(resolution != 1024x768)
    printf("This site was designed for a 1028x768 resolution. Your screen resolution is different from the one that is required to view this site properly. You may experience problems unless you change your screen resolution"); //Should be displayed at the top of the page in RED

    if(browser == IE)
    printf("This site can be ideally accessed from Firefox and Opera."); //Again this has to be in RED on the top of the page.
    END

    I want to be able to put this in a detect.js and include this in my page. Can someone please help me code this?
    Last edited by purifier; 12-14-2006 at 08:01 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You really are much better off designing your pages so that this is not needed.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry Sir... but i didn't get you

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    John is saying that doing this will cause a lot more problems than it will solve. Both for you and your visitors.

    He is saying that with minimal effort you can design your web pages so that this is not needed.

    That is unless you have a very specific need to do so, in which case you should post what that reason is, and at least a link to that page or paste the code here.

    More than likely there is a better alternative.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh. got it! Its not that I have a reason but it is only that I can't do it. I'm using Joomla with a template that is fixed and that which is designed for a 1028x768 resolution. And I didn't find a fluid template that fits my need except this one. Is there anyway I could make this template a fluid one? I presume the answer would be "not that easily" That was the reason... There's another reason which I'd say after I get an answer for my question of ease

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Will Joomla allow you to use other templates? I'm thinking of ones written in just plain HTML. if it doesn't, someone should get on it and write some fluid compliant templates for Joomla, there may even be some out there if you search hard enough for them.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah Joomla does allow Fluid Templates... but what I was trying to say is that there are so fluid templates that are suitable for my site.. thats the problem...

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by purifier View Post
    Yeah Joomla does allow Fluid Templates... but what I was trying to say is that there are so fluid templates that are suitable for my site.. thats the problem...
    This is such a major usability and maintenance issue that I strongly recommend that you find one that will work or that you adapt an existing one to make it serviceable to your needs.

    What happens is that, with browser detection, many browsers fail the test that should pass it and many pass that should fail. With new browsers added and old browsers updated frequently, this becomes even more of a nightmare.

    Resolution is irrelevant, a page should be able to be viewed in all common resolutions - that is not so hard to design for and doesn't require a fluid design. If nothing else, a centered or left aligned 776px wide block format will work.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •