1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Any good reasons to manipulate "<meta name="viewport"..." with JavaScript?

Discussion in 'HTML & Website Design' started by Gary-SC, Sep 10, 2019.

  1. #1
    Is there an odd but relevant scenario in which using JavaScript to detect a device and manipulate "<meta name="viewport"..." dynamically for each device is a reasonable idea?

    I recently came across a page that used "viewport.js" to define "<meta name="viewport"..." based on what device the page is loading and couldn't figure out why someone thought such trickery was necessary instead of simply using "<meta name="viewport" content="width=device-width, initial-scale=1">." Am I missing something here?
    SEMrush
     
    Last edited: Sep 10, 2019
    Gary-SC, Sep 10, 2019 IP
    SEMrush
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,921
    Likes Received:
    1,625
    Best Answers:
    232
    Trophy Points:
    515
    #2
    The only reason to do that is being a halfwit who doesn't understand what it does or why one would want to use it. Honestly varying from :

    content="width=device-width,height=device-height,initial-scale=1"

    Typically involves values that screws over the user's ability to zoom.

    What values specifically are they screwing with? dimes to dollars it involves either different initial-scale or different forcing of the zoom because the developer/designer was too stupid to use EM properly, or were pulling some sort of presentational game that has zero business on a website in the first place.

    Good rule of thumb? When you see someone using JavaScript to manipulate layout, you're looking at the triple "i" of web development. Ignorance, incompetence, and ineptitude.

    If you could share the link (if you don't want it public just PM it to me) I could give you a better idea what/why they are doing it that way. Dimes to dollars the whole page is a disaster of 3i.
     
    deathshadow, Sep 11, 2019 IP