I originally tried to code snippet below to try to reference a style sheet based on a users screen width:
if (screen.width>800) {document.write("<LINK REL... Src=\"styleHighRes.css\">"}
else {document.write("<LINK REL... Src=\"styleLowRes.css\">"}
I was successful accessing my desired style sheet but the original page that I wanted the style applied to, was covered up by a new page. The new page had whatever I specified in the document.write method, and not the original page hosting the javascript if statement.
Any suggestions to stop another page from opening up, and have the original page acquire the style specified in the style sheet?
Jeff
if (screen.width>800) {document.write("<LINK REL... Src=\"styleHighRes.css\">"}
else {document.write("<LINK REL... Src=\"styleLowRes.css\">"}
I was successful accessing my desired style sheet but the original page that I wanted the style applied to, was covered up by a new page. The new page had whatever I specified in the document.write method, and not the original page hosting the javascript if statement.
Any suggestions to stop another page from opening up, and have the original page acquire the style specified in the style sheet?
Jeff