1

I'm having trouble with a mobile page that uses a site of ours in an iframe.

It works fine on desktop but on mobile the page doesn't resize correctly. Based on internal testing it seems that the page is missing this meta tag: <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

Is there any way to set that via jQuery and have it actually take effect?

In theory I believe that using this SO article I could inject the meta tag like this:

$('head').append('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">');

But it seems the problem really comes down to forcing it to re-parse the html. Is there a way I could do that?

sauntimo
  • 1,531
  • 1
  • 17
  • 28
Tom Hammond
  • 5,842
  • 12
  • 52
  • 95
  • I'm finding it hard to fully grasp the scenario. I understand that there's an outer page containing an iframed page, but in which page will the jQuery run, and on which page are you expecting it to operate? – Roamer-1888 Jul 21 '17 at 07:04

1 Answers1

0

Yes you can append a meta tag, but no you can't force reparsing of the html. The browser is going to ignore any changes you make.

Nico Westerdale
  • 2,147
  • 1
  • 24
  • 31