Post Project
  • Browse
    • Browse Projects
    • Browse Offers
    • Browse Freelancers
  • How it works
  • Log in
  • Sign up
  • Freelancer?

Mobile browser redirect inside wordpress - code help

- or -

Post a project like this
£60
  • Posted: 7 years ago
  • Proposals: 1
  • Remote
  • #101592
  • Expired
Owain L. has already sent a proposal.
  • 0
  • 0

Description

Experience Level: Intermediate
We require a developer with experience of javascript & wordpress to help us with some mobile redirect code.

A javascript redirect has been put in on a test desktop website (http://outzoz.com/dave being used just to test this) to detect when the browser is a mobile, and if so, directs you instead to another test site : http://outzoz.com/latinis

This is the code that's in the index.html of http://outzoz.com/dave to do a conditional redirect based on browser agent :

<script type="text/javascript">// <![CDATA[
var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) { document.location = "http://outzoz.com/latinis"; }
// ]]></script>

This works fine, but the problem we have, is that when you're on http://outzoz.com/latinis using a mobile browser and click the "click to view desktop site" link at the bottom of the page, it redirects back to http://outzoz.com/dave, then the above code will again force the redirect to the mobile version of the site.

So we need some kind of exemption check in the above javascript code, so that it knows if you've clicked the view desktop button, to not redirect you again.
Dave L.
Dave L.
0% (0)
Projects Completed
2
Freelancers worked with
2
Projects awarded
50%
Last project
14 Nov 2011
United Kingdom

New Proposal

Create an account now and send a proposal now to get this project.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.
£60

- or -

Post a project like this
Dave L.
Dave L.
0% (0)
Projects Completed
2
Freelancers worked with
2
Projects awarded
50%
Last project
14 Nov 2011
United Kingdom

Related project Searches


desktop development JavaScript programming language mobile web testing wordpress (cms)
Product
  • About
  • Team
  • Careers
  • Blog
Support
  • How it works
  • Trust & Safety
  • Online Support
Resources
  • Customer Stories
  • Business Cost Calculator
  • Terms
  • Privacy
  • © 2019 People Per Hour Ltd