Different iframe embed or image depending on screen size

I know a lot may use css to do this but I am looking if there is a way using javascript on a webpage that will serve a different iframe [such as a you video with a different size] depending on detected screen resolution width. Also need away to do the same with serving different size images depending on screen width.

Tried this on a test page but all it gave me was a white screen...

<script type = "text/javascript">
var sw = screen.width;
if (sw <341) {
document.write('<iframe width="290"...

Different iframe embed or image depending on screen size

from JavaScript http://ift.tt/1U1ZwGe
via IFTTT
Previous
Next Post »
Thanks for your comment