Jump to content

mobile site redirect with full site link


ultraloveninja

Recommended Posts

I'm using the javascript version from http://detectmobilebrowsers.com/ to redirect to a mobile site. The only thing is that I have a link to go to the full site in the off chance that users want/need to go there.

 

However, when you click on the link to view the full site from the mobile, it picks back up on the redirection and kicks it back to the mobile version and not to the full site.

 

I was doing some searching and was wondering if it could be possible to hack it so that it uses

 

window.location.href.indexOf

 

or somthing of that nature like this:

 

if(window.location.href.indexOf("mobile/index.html") > -1)
{window.location = "http://thefullsiteURL.com"}
else { function (a, b) {
if (//mobile direction stuff from detectmobilebrowsers.com
})(navigator.userAgent || navigator.vendor || window.opera,
'http://thefullsiteURL.com/mobile/index.html')};

 

Does that look like it's even possible?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.