Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Media query redirect?

    Crude idea:
    <link rel="dummy" type="html"
    media="max-device-width: 480px)"
    href="GnuPage.html" />

    That is to say, i would like to do a re-direct if the screen is 480px or smaller.

    Possible? How?
    Thanks.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,727
    Thanks
    6
    Thanked 1,014 Times in 987 Posts
    Why would you want to do this? That’s basically the historic approach of graceful degradation where you have to maintain more than one version. Also, what does screen size have to do with this? What you call “screen size” is actually “viewport size”, in layman’s terms: “window size”. I can resize my browser window on my 24" desktop screen as I like – why should I want/have to be redirected? And what happens if I load a page while having a big browser window and then resize my viewport?

    Before anyone can tell you if what you want is possible you have to first tell us what exactly is your intention. It’s very likely that you are misconceiving something here.

  • #3
    New Coder
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry about the delay, in muddle of moving.
    Do not know difference (if any) between view port and view screen.
    All i know is if i A) set PC screen resolution to less than * by 480, or B) mobile phone resolution is similarly poor, i need a different webpage to have a reasonable presentation.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,727
    Thanks
    6
    Thanked 1,014 Times in 987 Posts
    Yeah, and this is what CSS and its media queries are there for, and this is why there is a concept called separation of presentation and content: The content (HTML code) stays the same while the presenation (CSS) is changing. You don’t maintain different HTML pages just to have a different presentation. Look at http://css-tricks.com/css-media-queries/, and don’t just read the tutorial, resize your browser window and look what happens to the layout along the way. The widest viewports get rounded tabs at the top; the narrower it gets first the tabs become rectangular, and at some point the whole layout is changing from two columns to one column. This is all happening on the same page, there is no redirect.

  • #5
    New Coder
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry about long delay; moving is the pits;still have not found a lot of things.

    I have fiddled with screen resolution,image and text sizes,placements,etc & etc
    The problem is that there are a few cell phones that barf with "page too large" and/or cannot render even one pix unless totally different than what is very useful in other venues.
    So, i MUST re-direct and maintain a single, different HTML page just to have a different presentation for that and similar el-cheapo (or is that el-chintzy?) cell phones.

    May re-Pete, how do i do something like:

    <link rel="dummy" type="html"
    media="max-device-width: 480px)"
    href="GnuPage.html" />

    That is to say, i would like to do a re-direct if the screen is 480px or smaller.

    Thanks.

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,311
    Thanks
    11
    Thanked 285 Times in 284 Posts
    In Ye Olden Days, we used to do this by sensing the type of browser being used (by reading the User Agent string) and then redirecting to a page as you suggest. That's still possible, though fraught with issues, which is why media queries were created. Off the top of my head, I don't know of another way to do what you're wanting.

  • #7
    New Coder
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Check; i know about "browser sniffing" and with a slight amount of care, it is very reliable for the PC browsers, and a bit messy if one is not fussy to select mobile phones.
    And i could sharp-shoot for the specific mobile phone that i know has barf problems.
    But, i am sure that there are others with similar problems.
    Cannot afford to buy and test the thousands of mobile phones for eXplicit testing; rather X-rated and objectionable giving exposure of one's financial skin.
    So, the media test is highly preferred; if a few mobile phones happen to be able to render a nominally large page and get "dumbed down", that is acceptable to me.

    Possible "step-back" scheme like this?
    <link rel="stylesheet" type="text/css"
    media="min-device-width: 480px" href="css/PeeCee.css"
    />
    ...where PeeCee.css has ALL of the junk in all of the .CSS.
    Perhaps with NO CSS the whole page goes into hyperspace?
    or..
    the CSS can "jump" to a particular location in the HTML and ll else ignored?

    Color me rather stupid, clueless and ignorant.
    Some dirty trick? eXplicit frames / noframes?

  • #8
    New Coder
    Join Date
    Aug 2013
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts
    (Grumble..) OK, so eXactly how is a media re-direct coded, and exactly how does it work / what does it do?
    A working example for me to fiddle with would be appreciated.
    Thanks.

  • #9
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,311
    Thanks
    11
    Thanked 285 Times in 284 Posts
    I've never even heard of a "media re-direct" - where are you getting this term from?

  • #10
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    API is used in a Remote Desktop session to identify areas of the server that are displaying fast changing content


  •  

    Tags for this Thread

    Posting Permissions

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