views:

22

answers:

1

Is there a way to make the Iframe request an external website as if it is a mobile device, so the content returned will have a small dimension etc?

I am displaying external websites in iframes, using width and height attributes

<iframe src="http://marketwatch.com" width="300px" height="300px"  ></iframe>

but because the browser is not a mobile browser, the content returned is tailored to normal browser, and I end up having scrollbars.

If the content returned is that for a mobile device, then no more scrollbars etc.

A: 

It depends on how the website detects if it should be a mobile browser.

If the site has a mobile-specific URL you can go to that always renders the mobile site, then just go to that.

If it looks at the user-agent string and does things like that then you might not be able to do it. I think a lot will detect based on the user agent, but just redirect to a mobile version of the site though. If you know the mobile version of the site then you can just use that and it should be fine.

Of course, this requires you to know before hand what sites you want to use. Not sure if there's a generic solution.

Herms