homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Mobile Internet / Mobile Web Site Design and Development
Forum Library, Charter, Moderators: not2easy

Mobile Web Site Design and Development Forum

Redirecting users to mobile version of site

Msg#: 4590122 posted 7:46 pm on Jul 3, 2013 (gmt 0)

I wasn't sure what forum this belonged in but here's the issue I'm having...

I am using the following code in my websites pages...

<!-- CSS -->
<script type="text/javascript">
if (screen.width <= 699) {
window.location = "http://m.example.org/";
<!-- CSS -->

That code determines the screen width and if it's less than a certain amount it redirects the user from the main desktop site to the mobile version of the site. It works perfectly, however there is one issue...

When the user clicks the 'View Full Site' button on the mobile site it takes them to the full site but then loops them right back to the mobile version since it has determined their screen width is too small.

Is there a way I can remedy this because it seems to be eluding me...

[edited by: bill at 1:09 am (utc) on Jul 4, 2013]
[edit reason] use example.org [/edit]


Global Options:
 top home search open messages active posts  

Home / Forums Index / Mobile Internet / Mobile Web Site Design and Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved