if(widgetStylesPrinted != true) {document.write('');}var widgetStylesPrinted = true;var content = '
redirect to m.
javascript
  1. function showMobilePage() {
  2. subdomain = 'm';
  3. if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
  4. thisUrl = location.href;
  5. if (thisUrl.indexOf('www') != -1) {
  6. mUrl = thisUrl.substr(thisUrl.indexOf('www')+4, thisUrl.length);
  7. if (thisUrl.indexOf('https://') != -1) {
  8. mUrl = 'https://' + subdomain + '.' + mUrl;
  9. } else {
  10. mUrl = 'http://' + subdomain + '.' + mUrl;
  11. }
  12. } else if (thisUrl.indexOf('http://') != -1) {
  13. mUrl = thisUrl.substr(thisUrl.indexOf('http://')+7, thisUrl.length);
  14. mUrl = 'http://' + subdomain + '.' + mUrl;
  15. } else if (thisUrl.indexOf('https://') != -1) {
  16. mUrl = thisUrl.substr(thisUrl.indexOf('https://')+8, thisUrl.length);
  17. mUrl = 'https://' + subdomain + '.' + mUrl;
  18. } else {
  19. mUrl = thisUrl;
  20. }
  21. location.href=mUrl;
  22. }
  23. }
';document.write(content);