[ic] Specify flypage using javascript or another non-database method

Josh Lavin josh at perusion.com
Mon Apr 27 15:19:06 UTC 2015


Quoting Mike Heins (mikeh at perusion.com):
> Quoting Peter (peter at pajamian.dhs.org):
> > On 04/27/2015 07:10 AM, DB wrote:
> > >>> Hi all. I'm working an making IC5 site a bit more mobile friendly and so
> > >>> far it's been fairly painless. Using javascript to redirect mobile
> > >>> visitors to the mobile version of a page works well. But I now need a
> > >>> way to make mobile visitors see a different flypage than non-mobile
> > >>> visitors see.
> > 
> > > Thanks - I'd been using something like below but I see other ways in the
> > > archives that would probably work better with your example.
> > > 
> > > <script type="text/javascript">
> > > <!--
> > > if (screen.width <= 699) {
> > > ...
> > > }
> > > //-->
> > > </script>
> > 
> > Using javascript is all well and good, but you do have to direct them
> > after the page is loaded and then load another page as a result.  If you
> > use server-side code to detect the presence of a mobile based on the
> > UserAgent string then you can use Mike's code above to do it without
> > needing a redirect.  I suggest using the HTTP::BrowserDetect module to
> > parse the useragent string for you.  It has, among others, methods that
> > tell you if it's a mobile device and whether it's a tablet, etc.
> 
> I think you can find the is_mobile tag in our repository, it is something
> we use for the Strap catalog, I believe. If not, here it is:

>From here:
https://github.com/perusion/interchange-extras/tree/master/mobile

-- 
Josh Lavin
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
... ask me about job opportunities ...



More information about the interchange-users mailing list