SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Location
    Brisbane, Australia
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Java Script for redirecting

    Hi

    I am using a java script to redirect from my website if it detects a mobile site by using less than 600 pixels

    Can I add a java script to my mobile site so it will redirect them to my my main desktop site if greater than 600 pixls and what would it be.

    Quentin

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,192
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    window.location

    You would need to make sure the browser support JavaScript before trying it though

  3. #3
    SitePoint Member
    Join Date
    Oct 2010
    Location
    Melbourne, Australia
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Quentin,

    Better to just have a link from your mobile back to your main site, that way people have the choice.

    Also - Back on your main site, check the http_referer and if they're coming in from the mobile site (or your main site) then dont redirect them to the mobile site. This breaks the redirection loop.

    Cheers
    Richard


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •