Mobile site redirect

Direct JS way:

if( isTouchScreen )

window.location.replace(“http://fairfax.va.golookon.com/mobile”);

 

这个方法会先load full site  页面,不太好~而且即使用户点了full site链接也会被redirect到mobile site。

 

Use  redirection_mobile.min.js

Get the JS file here.

code:

<script type=”text/javascript” src=”/redirection_mobile.min.js”></script>
<script>
SA.redirection_mobile ({
tablet_redirection : “true”,  //tablet也redirect
mobile_url : “fairfax.va.golookon.com/mobile”
});
</script>

这样通过cookie的方式,用户只有第一次会被导入mobile site。

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s