SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Set a php variable according to a javascript condiitional

    Hello all, I'm new to php and javascript and what not... but hopefully there is someone out there that has an answer.

    With jquery I detect screen resolution. I set a conditional : if screen is bigger than... and smaller than... then...

    Now if that conditional is given I want to set a php variable. How?

    Any guidance would be greatly appreciated.

    Andres

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php runs on the server, js runs on the client, so in general you can't

  3. #3
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So say you need to detect the resolution of a browser and according to that you need to load one image or another. How would you go about it?

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Load a default image (or placeholder, possibly hidden) and have JS replace it when it works out the screen size.

  5. #5
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you i'll look into it!


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
  •